I have installed ranger file manager and rxvt-unicode terminal, and I want ranger to display previews of images in the terminal. I have also installed w3m, but I can't get images to preview. I think this is an issue for w3m, because when I load webpages with w3m, no images appear.
edit: w3m will now display images when i load webpages and images, but ranger does not preview....
I am running Ubuntu 18.04.4 LTS x86_64 I think I need to get urxvt with pixbuf support, but I have no idea how to get that. I have tried searching to find out how to get urxvt with pixbuf support, but only results for arch etc. is available it seem like.
TL;DR
ueberzug
with:pip3 install ueberzug
My other trials
I just had the same experience as you and I couldn't make it work but I have a few notes on your trial and a pretty easy alternative that actually worked
First thing first w3m package of ubuntu doesn't contain image preview so you need to explicitly type
sudo apt install w3m-img
then you need to locate it on the path at a place like/usr/lib/w3m/w3mimagedisplay
and add it to your path .Though this installation of w3mimagedisplay seems broken to me you might have better luck.Also kitty as suggested by the other answer worked for me , though I didn't have time to change my default terminal as I have a lot of configurations on it. So I count these solution more "lightweight" as it just needs one python script to run. Even though kitty is a handy terminal and many people might prefer itRanger does not have image previewing enabled by default. You need to enable it in its configuration file.
First, ensure that you do have a user-specific config file (
~/.config/ranger/rc.conf
). If you don't, create the config directory (by runningmkdir -p ~/.config/ranger/
) and copy the default one into it (by runningcp /usr/share/doc/ranger/config/rc.conf ~/.config/ranger/
), then open it (the user-specific one, that is) with your favorite text editor.To enable image previews, find the
preview_images
option and change it totrue
. i.e. the line would read:Then, find the option
preview_images_method
, and set it according to your terminal to one of the values enumerated and explained in the comment block preceding it. In your case, it'surxvt
. So the line would read:After that, quit ranger and start it again for the new configuration to take effect.
If all fails, I personally use it with the Kitty terminal and it works. If you want to try it out, first install Kitty, change the aforementioned
preview_images_method
option tokitty
, then launch kitty and start ranger in it.