Album Art On Your Linux Terminal

I wrote an early version of a script to show album art in the terminal nearly a decade ago. This version is a lot better.

Image showing a terminal screen with multiple TUI programs running, including one showing album art in the bottom right pane.

The second version of terminal_covers.sh is much better. Using the basic logic (and limited cache system) as my yadshow program, along with help from qdbus, it’s able to pick up covers from a much wider range of players without any user input. Currently supports Clementine, Strawberry, PlexAmp, and MPD out of the box (in that order of priority).

Note for MPD

You should set MPD_HOST or have it exist in .bashrc; if neither is set, it will go with the defaults, which will fail if you have a password set. MPD_HOST=PASSWORD@HOST If you have a non-standard port, you’ll need to edit the script. It assumes your music’s base directory is ${HOME}/Music

terminal_covers.sh also uses a range of tools to convert the image into something even a pretty non-advanced terminal can show. It rounds rectangles of the coverart (useful if you pickup the resulting image with something like conky) using imagemagick if installed, and will use (in this order)
these tools to render the images: timg, jp2a, img2txt.py, asciiart. jp2a and asciiart are in Debian repositories, but timg is worth it.

terminal_covers.sh can also optionally give you a notification via notify-send if you run it with --notify as the (only) argument.

It runs in a terminal window on a timed 2-second loop. If the song information is unchanged, it does nothing. If it’s changed (either because another player started or the track changed),
then it figures out what the album art is and goes from there.

You can also use the output files in ${HOME}/.cache/yadshow/ with other programs to get the song information and cover as well.

You can find terminal_covers.sh at GitHub, GitLab, or my own git repository.