Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use lsix to display thumbnails under Linux

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use lsix to display thumbnails in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Fim is a lightweight command-line image viewer application that displays various types of images from the command line, such as bmp, gif, jpeg, and png. I stumbled upon a similar tool called lsix. It is similar to the ls command in Unix-like systems, but only for images. Lsix is a simple command-line utility designed to display thumbnails in a terminal using the Sixel graphics format. For those who want to know, Sixel is an abbreviation for six-pixel pixels, a bitmap graphics format. It uses ImageMagick, so almost all the file formats supported by imagemagick work properly.

Install lsix

Because lsix uses ImageMagick, make sure it is installed. It is available in the default libraries of most Linux distributions. For example, on Arch Linux and its variants such as Antergos, Manjaro Linux, you can install ImageMagick using the following command:

$sudo pacman-S imagemagick

In Debian, Ubuntu, Linux Mint:

$sudo apt-get install imagemagick

Lsix does not need to be installed because it is just a Bash script. Just download it and move it to your $PATH. It's that simple. Download the latest lsix version from the GitHub home page of the project. I download the lsix archive package using the following command:

$wget https://github.com/hackerb9/lsix/archive/master.zip

Extract the downloaded zip file:

$unzip master.zip

This command extracts everything into a folder named lsix-master. Copy the lsix binaries from this directory into $PATH, for example, / usr/local/bin/.

$sudo cp lsix-master/lsix / usr/local/bin/

Finally, make the lsix binaries executable:

$sudo chmod + x / usr/local/bin/lsix

Thus, it is time to display thumbnails in the terminal itself.

Before you start using lsix, make sure your terminal supports Sixel graphics format.

The developer developed lsix on Xterm in vt340 simulation mode. However, he claims that lsix should apply to any Sixel-compatible terminal.

Xterm supports the Sixel drawing format, but it is not enabled by default.

You can use the command from another terminal to start a Xterm with Sixel mode enabled:

$xterm-ti vt340

Alternatively, you can make vt340 the default terminal type for Xterm, as described below.

Edit the .Xresources file (if it is not available, just create it):

$vi .Xresources

Add the following line:

Xterm*decTerminalID: vt340

Press ESC and type: wq to save and close the file.

Finally, run the following command to apply the changes:

$xrdb-merge .Xresources

Now, Sixel graphics support is enabled by default every time you start Xterm.

Display thumbnails in the terminal

Start Xterm (don't forget to start it in vt340 mode). Here's what Xterm looks like in my system.

As I have already said, lsix is very simple and practical. It does not have any command line options or configuration files. All you have to do is pass the path to the file as an argument, as shown below.

$lsix ostechnix/logo.png

If you run it without a path, it displays the thumbnail image in the current working directory. I have several files in a directory called ostechnix.

To display the thumbnails in this directory, simply run:

$lsix

You see that? Thumbnails of all files are displayed in the terminal.

If you use the ls command, you can only see the file name, not the thumbnail.

You can also use wildcards to display specific types of specified images or a set of images.

For example, to display a single image, simply mention the full path to the image, as shown below.

$lsix girl.jpg

To display all images of a particular type, such as PNG, use the wildcards shown below.

$lsix * .png

For the JEPG type, the command is as follows:

$lsix * jpg

The display quality of thumbnails is very good. I thought lsix would show blurry thumbnails. But I was wrong, and the thumbnails are clearly visible, just like in a graphic image viewer.

Moreover, all of this is readily available. As you can see, lsix is very similar to the ls command, but it is only used to display thumbnails. If you work with a lot of images, lsix may be very convenient.

Thank you for reading! This is the end of this article on "how to use lsix to display thumbnails under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report