The latest versions of Conky can be used to not just display text but also images, amongst other cool stuff like drawing gauges and use Lua scripts.  I’d been using it for quite some time to display track information from Amarok. Now I finally have a way to display cover art as well.

Conky displaying Amarok album art - work in progress

If you’re already running Karmic then you can install the latest version from the repositories. Install the conky-all package which has most compile options enabled to get the latest features. You’ll also need imagemagick installed.

First we need a script to fetch the cover and convert it into an album stack. The angle of the covers changes slightly with each track. It also resizes each stack to 150×150. Click here and save it as ~/bin/getcover. As you can see I had some help with it – thanks to eightmillion from the Ubuntu forums for completely rewriting it to something useable ;)

Next get the script to pull the rest of the track info from Amarok – click here and save as ~/bin/askamarok. Try it from the command line whilst Amarok is playing, e.g. to get the artist name enter

askamarok artist

Other available info is title, album, year, genre, bitrate, track playing time, total track playing time… You can also get collection info and stats. For the stats Amarok needs to store the collection in a MySQL database.

Finally get my Conky script and save as ~/conkycover. To run it:

conky -c conkycover

If it’s the only Conky script you’re running then save it as ~/.conkyrc and start Conky without any options.

Last thing missing is the cover when Amarok is not actually running. Save the following image as ~/conky/cover/noplay.png:

noplay

The whole thing is a bit rough. For example, not all the info updates at the same time on track changes. And although I set the update interval for the playing times to 1 second it leaves 3 seconds in between. It also does not look the best when no track is playing, or Amarok is not running. Feel free to post any improvements/ideas in the comments as my Conky layout skills leave a lot to be desired ;)


Possibly related posts:

  1. Access Google Calendar from the Command Line
  2. Organise your music collection with EasyTAG
  3. Associate .torrent files with uTorrent running under Wine
  4. Enable S-video on ATI cards
  5. Easy NFS share with auto-mount