Get A Quick Popup Of Your Current Cover Art From The Music Player Daemon (MPD)

I’ve messed with different ways to display my music’s cover art over the years — as well as different players — but I end up sticking with MPD. I’ve developed a big huge overblown system (which works, mind you) to display cover art using conky, but I often have applications covering my entire screen.

So I made something that will pop up the cover art (along with the title, album, and artist) of the currently playing song in MPD and then go away.

This script — which should also have an image file named defaultcover.jpg in its directory — requires mpc, imagemagick, and YAD to create a popup with the albumart and trackname of the currently playing song from MPD, the music player daemon.

It assumes your music directory is in ${HOME}/Music, that your album art is named either cover.jpg or folder.jpg and that mpc is already set up correctly. The window will auto-close after 10 seconds.

It will attempt to use the environment variable MPD_HOST, and if it is not found, will examine ${HOME}/.bashrc to see if it is set there (if a non-login shell) and set it for the program. If you have a password set for MPD, you must use code>MPD_HOST=Password@host for it to work.

You can find the script at GitHub, GitLab, or my own git repository.