fophillips dot org‣ May 28th, 2008‣ Amarok in dzen
I use this little script with dzen and dmplex to show the current song info in a little bar at the top of my right-hand screen. You need to make sure you have dcop up and running.
#!/bin/zsh
while true; do
ARTIST=$(dcop amarok player artist)
ALBUM=$(dcop amarok player album)
TITLE=$(dcop amarok player title)
SONG="${TITLE} - ${ARTIST} (${ALBUM})"
CURTIME=$(dcop amarok player trackCurrentTime)
(( CURMINS = $CURTIME / 60 ))
(( CURSECS = $CURTIME % 60 ))
TOTTIME=$(dcop amarok player trackTotalTime)
(( TOTMINS = $TOTTIME / 60 ))
(( TOTSECS = $TOTTIME % 60 ))
MEDIA="${SONG} [$(printf '%02d:%02d/%02d:%02d'
$CURMINS $CURSECS $TOTMINS $TOTSECS)]"
echo "2 ${MEDIA}"
sleep 1s
done
dzen, amarok, zsh