lsix, a variant of the ls utility for displaying images in the terminal

As part of the lsix project, a version of the "ls" utility specifically for images is being developed , which allows visual evaluation of the images displayed in the terminal when executing the code.

Thanks to the display of graphic thumbnails in the terminal. To display graphics in a text terminal, even when working remotely via SSH.

Given this, it is intended to make the use of pixels (sixel, 6-pixel block image design). The project code is written in bash and distributed under the GPLv3 license.

About lsix

To manipulate the graphics, the utilities of the ImageMagick package will be used, which provides the ability to display not only thumbnails of various graphic formats , but also the generation of thumbnails for PDF documents, vector graphics (SVG) and multi-layer formats (XCF).

To speed up the output of a large number of thumbnails, each image is drawn line by line. A useful feature of lsix is ​​also support for frame-by-frame display of animated images.

Of the main characteristics of this command, the following can be listed:

  • Automatically detect whether your terminal supports Sixel graphics or not. If your Terminal is not compatible with Sixel, the user will be notified to enable it.
  • Automatically detects the background color of the terminal.
  • It uses terminal escape sequences to try to figure out the foreground and background colors of your Terminal application and will display the thumbnails clearly.
  • If there are more images in the directory, usually> 21, lsix will display those images one row at a time, so you don't need to wait for the entire montage to be created.
  • It works well with SSH, so you can manipulate the images stored on your remote web server without much hassle.
  • Supports non-bitmap graphics such as .svg, .eps, .pdf, .xcf, etc.
  • Written in BASH, it works on almost all Linux distributions.

How to install lsix on Linux?

For those interested in installing this utility on their systems, they should know that they must have ImageMagick installed, as it is a necessary dependency for this command.

To install lsxis, we only need to obtain its bash shell. Therefore, we will open a terminal on our system and type the following command:

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

And having obtained the compressed package, we will decompress it with:

unzip master.zip

Now we are simply going to copy the lsix file into our binaries directory (/ usr / local / bin):

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

If you do not have imagemagick installed on your system, you can install it from your distribution repositories, since it is a well known package used in Linux.

Users of Debian, Ubuntu, and any other distribution derived from these, only need to type the following command in the terminal:

sudo apt-get install imagemagick

If you are a user of RHEL, CentOS, Fedora or any distribution derived from these, you can install ImageMagick with:

sudo dnf -i imagemagick

For users of Arch Linux, Antergos, Manjaro and Arch Linux derivatives, install the utility with:

sudo pacman –S imagemagick

While for those who are openSUSE users, the installation is done with:

sudo zypper in imagemagick

How to use lsxis?

To use this command, you need a terminal that supports the VT340 standard, for example, xterm.

But in xterm, support for this spec is disabled by default, and to turn it on.

Terminal type must be explicitly specified at startupr «xterm -ti vt340»Or change the default settings (in. Xresources, add "xterm * decTerminalID: vt340»And apply the changes by running xrdb -merge .Xresources«).

Of the useful applications of lsix, we can note the possibility to quickly evaluate the images on external servers when logging in via SSH, without downloading these images to the local system.

The use of this utility is really simple, since it works with graphics, we can ask it to show us all the existing ones in a specific directory or path, the basic command is:

lsxi

If we want it to show us a specific type of image, we only have to type the following, for example jpeg:

lsxi *jpeg

Finally, the utility can also show us pdf files in the list.


Add as preferred source in Google