Rewrite

Rewrite

努力学习的前端小菜鸡(:з」∠)_
github
telegram

Using image preview in ranger on the st terminal.

Using ranger for image preview in st terminal

Issue#

I am unable to see images when using ranger for image preview in the st terminal. However, there is no issue when using xterm, which makes me suspect that it is a problem with st, as it is too minimalistic. So, I found this issue on ranger's GitHub page.

Solution#

The person in the mentioned issue had the same problem as me, where the w3m preview method was not working. They were able to successfully preview images by using the ueberzug preview method. So, the problem can be easily solved by installing ueberzug and modifying the rc.conf file to set preview_images_method to ueberzug.

Installing ueberzug#

Installing ueberzug is simple. I am using ArchLinux, so I found the ueberzug package in the AUR repository.
However, there are two packages in the AUR repository, one is python-ueberzug, and the other is python-ueberzug-git.
Based on the experience of the person in the issue, the first package has some problems, so I installed the second one.
yay -S python-ueberzug-git

After a certain version update, there were issues with the preview. Uninstalling and reinstalling the ueberzug package from the official repository can solve the problem.

sudo pacman -S ueberzug
For other distributions, you can install it using pip.
sudo pip3 install ueberzug

Preview Images#

Previewing images is a great experience!
Image 1
Image 2

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.