Show MPD’s Album Art On The Desktop With Vindauga

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

blankWas this post helpful or insightful? Buy me a coffee here or here and share this post with others!

Popular posts:

  • The difference between boundaries and rules
  • Two Ways to get CMYK Separation Using GIMP Instead of Photoshop in 2022
  • Weekend Project: Whole House and Streaming Audio for Free with MPD
  • If there's one Nazi (or a racist) at the table...
  • Word Porn Quotes
  • Odds and Ends: Optimizing SSHFS, moving files into subdirectories, and getting placeholder images

Recent Posts