If you have looked around any ricing/unixporn esque forums you will likely have
encountered someone's fetch or other utility that is showing their favrouite anime girl.
As great of a technology as this is, it remains fundamentally a hack, this isn't a negative
in in of itself however it makes portability, and the maintaining of such projects that incorporate
these really difficult. Currently there seems to be an implementation done by every major
terminal emulator, such as kitty or alacritty. The original implementation, namely uberzug
(now reimplemented as ueberzupp) uses a daemon to create an X window confined to the terminal,
rather than paticular escape sequences. However it seems as if this is no longer the default
option, though in my opinion, it's the best, purely because none of these implementations
work in plain tty and as such doing away with it as it 'requires you to be in a X' to function
is here nor there. The fact that it also supports gifs just makes it all in all the best,
aside from the slightly higher resource usage.
I've made some scripts myself that make use of this, such as displaying coverart of music
playing in ncmpcpp. And I will say that it's much more unwieldy to use ueberzug in place
of alternatives. But for my aformentioned reasons I still continue to use it.
1
2#!/bin/bash
3export PS1=''
4
5UB_PID=10
6UB_SOCKET=""
7
8pkill -x "ueberzugpp" || true
9
10UB_PID_FILE="/tmp/.$(uuidgen)"
11ueberzugpp layer --no-stdin --silent --use-escape-codes --pid-file "$UB_PID_FILE"
12UB_PID=$(cat "$UB_PID_FILE")
13export UB_SOCKET="/tmp/ueberzugpp-$UB_PID.socket"
14
15CACHE=/tmp/albumcover
16
17while (true) do
18 if [ -e /tmp/albumflag ]; then
19 rm /tmp/albumflag
20 #SONG=$(cmus-remote -Q | sed -n '/^file/s/^file \(.*\)$/\1/p')
21 SONG=~/Music/"$(mpc --format %file% current)"
22 ffmpegthumbnailer -i "$SONG" -o "$CACHE" -s 500 -q 10
23 ueberzugpp cmd -s "$UB_SOCKET" -a add -i PREVIEW -x 0 -y 0 --max-width 200 --max-height 200 -f "$CACHE"
24 clear
25 #exiftool -Lyrics "$SONG" | sed -e 's/\.\.\+/\n/g' -e 's/\./\.\n/g'
26 fi
27 sleep 1
28done