Show MPD’s Album Art On The Desktop With Vindauga

The post with updated information is here: https://ideatrash.net/2023/11/show-album-art-on-the-desktop-with-vindauga-and-conky.html

I have written vindauga – a fork of kunst – to display album art on the desktop (or via conky) when music is being played via MPD.

Why did I write this? Well, I’ve written before about my love for MPD – the Music Player Daemon, a flexible server-side music player. For example, I showed how I use snapcast to get whole-house audio, can easily select music from the commandline, get really good volume normalization, create an autoqueue, and make genre/BPM specific playlists.

And there’s lots of interfaces for MPD – the web interfaces I’ve found most useful are O!MPD and RompR. Those are nice when I’m away from home, but I don’t want to fire up a web browser to listen to music, but all of the local GUI interfaces are either too in the way… or don’t show cover art. (Or worse, don’t fetch it properly – I’m looking at you, Ario, GMPC, and Cantata.)

That is not acceptable.

Perhaps I was spoiled by Guimup for GTK (later Quimup for QT). It was a program with a streamlined interface, displayed the album art and such in a small footprint by default, and just worked.

Until, well, it didn’t.

The libraries that Quimup depends on have changed in the years since it was last updated – four to six years ago, depending on which repository you look at.

I don’t mind using other shortcuts (or the terminal) to choose music, but dammit, I want to see the frigging cover art. So I was thrilled to run across kunst last week… until it didn’t work entirely right for me either.

So I wrote vindauga.

vindauga does not loop on a timer. Instead it waits for mpd to send a “player” event. When it receives a “player” event, it wakes up and takes action. This makes vindauga really lightweight as a daemon.

When vindauga wakes up, it looks at the currently playing track from mpd. It then checks its own cache of album artwork (see below for details), then the music folder, then embedded artwork, then the CoverArt Archive (if the music has the MusicBrainz ID embedded), then Deezer.

If none of those exist, it checks if there is a configured local directory with images in it designated as placeholder images. If that doesn’t exist, it checks for a designated placeholder image.

If that doesn’t exist, it will use the optional simple_placeholder_images to download a nice picture from online and use that as a temporary album cover.

If that doesn’t exist, then it decodes a built in default album image to the cache directory.

At that point, sxiv or conky can display the image.

The filestructure in the cache is meant to be fairly straightforward and obvious so that the images may be used (if desired) with other programs.

vindauga means “window”.

I plan to have vindauga provide cached images to Ario and other programs (and perhaps save/embed album art) in future versions. You can find vindauga at GitHub, GitLab, and my own Git repository.

Featured Photo by Florencia Viadana on Unsplash