w3m, kitty and inline images
What?
I like kitty, “The fast, feature-rich, GPU based terminal emulator”. Yes, I really do. I also like using w3m, a relativly old but nice console-based webbrowser. Now kitty can actually display real images in it’s view but I had a harrd time in finding out how
- to configure kitty,
- to configure w3m,
- and which dang library is actually in use.
Finding the information turned out to be hard, so here, without further ado, what needs to be done.
How it looks like:
Figure 1: Screenshot of w3m running in kitty, displaying images, in action
Instructions
Common
Obviously: Install kitty.
Fedora 36
Luckily the w3m shipped with FC36 was already compiled ‘The Right Way™’ and
all you need to do is configuring the correct image protocol & enable loading
of pictures. Open /etc/w3m/config
(as root
) or create your own
~/.w3m/config
, adding these two statements:
inline_img_protocol 4
auto_image TRUE
Boom, works.
Debian bullseye/sid
No luck here, w3m too old. Hence uninstall any existing w3m and it’s
complimentary package w3m-img
and compile a fresh one.
git clone https://github.com/tats/w3m
cd w3m
./configure --with-imagelib=imlib2
make -j4
sudo make install
Turned out I need to compile against imlib2. Maybe other libs work too, but this worked for me right away.
Finally, create a copy of /usr/local/etc/w3m/config
with just the two
statements from the previous chapter.