Continuing my Conky post series, I will introduce you to the integration of Amarok 2 into Conky. I prefer this option over the OSD (On Screen-Display for song information) any day. The reason is that the OSD will only appear at the beginning of a song and while it does that, it tends to be in the way. I’m aware that you can change the position, but I’m still not happy with that. Wherever it is, it will overlay your internet browser, image editor or similar. Not being able to check what song is curently playing (if you missed the start) and sometimes simply not wanting to see every song are other reasons for me to implement Amarok 2 into Conky. I repeatedly said Amarok 2, because the integration of Amarok 1 is a different story.
Read my Conky article if you still don’t know where to start with Conky. Otherwise copy and paste this into your .conkyrc file:
${color #000000}Music ${hr 1}
${color #BBB3B3} ${execi 10 ~/.conky/amarok artist}
${color #BBB3B3} ${execi 10 ~/.conky/amarok title}
${color #BBB3B3} ${execi 10 ~/.conky/amarok album}
${color #BBB3B3} ${execi 10 ~/.conky/amarok year}
${color #BBB3B3} ${execi 10 ~/.conky/amarok genre}
For further questions on this, visit this forum, where additional questions and ideas on my code are available. Afterall, this is just a basis you can build upon.
After you integrated the above text, you will need to install qdbus which is available in the software packages.
Until now, this by itself will not work. As you can see in the above text, I referred to ./conky. This is the folder you will need to create a new document in, I called amarok. As far as I know you can change both folder- and filename, but it must be changed in the above text accordingly. Now you can copy and paste the following content into the just created file (yes we’re almost done
):
#!/bin/bash
# based on: amaroK info display script by eirc <eirc.eirc@gmail.com>
# amarok2 info display script by fireandfuel <fireandfuel@hotmail.de>
#
# requirements: amaroK 2 (!)
case “$1″ in
# Now Playing Info
artist) qdbus org.kde.amarok /Player GetMetadata | grep artist ;;
title) qdbus org.kde.amarok /Player GetMetadata | grep title ;;
album) qdbus org.kde.amarok /Player GetMetadata | grep album ;;
year) qdbus org.kde.amarok /Player GetMetadata | grep year ;;
genre) qdbus org.kde.amarok /Player GetMetadata | grep genre ;;
esac
Once this file is saved, type the following command into your console: chmod u+x name_of_the_script. If the document (script) is placed elsewhere then your desktop, you will have to add the details about that into the command or change into the folder where the file is save and enter the command there. Restart Conky and enjoy Amarok 2 details on your desktop.



Comments
Leave a comment Trackback