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.
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:
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:







February 16th, 2010 on 11:08 pm
nice work! does it work with amarok 1.4? because i can’t get it working…
February 16th, 2010 on 11:48 pm
It only works with 1.4. I should have mentioned that in the post.
How is it not working for you?
March 25th, 2010 on 4:56 am
Nope, works just great on 2.3.0.
Well, it does now, after I changed it to use dbus instead of dcop =P
Some of the advanced displays got lost in translation, but as long as I have the cover, title, artist and album, I’m happy.
April 15th, 2010 on 8:55 pm
Christian, how did you get it to work with newer versions? Just find and replace dcop with dbus in askamarok?
April 15th, 2010 on 10:57 pm
Unfortunately it’s not as straight forward as that. I had a go at rewriting it for Amarok 2 some months back and as Christian mentioned not everything had been implemented yet. Maybe it has now, not sure.
Anyway, here’s an example I used for the artist info:
artist) qdbus org.kde.amarok /Player GetMetadata | awk '/artist:/{print substr($0,9)}' ;;