For the sake of them that cannot download the script, here it goes in plain text format:
##BEGIN
#!/bin/bash
#===================================================================================
#
# FILE: amarok_now_playing
#
# USAGE: amarok_now_playing [ > logfile]
#
# DESCRIPTION: Changes your status message in pidgin and/or
# Kopete to the song you are currently listening to in Amarok.
#
# OPTIONS: see function ’usage’ below
# REQUIREMENTS: --- Amarok 1.4.10, purple-remote, Pidgin 2.5.2 or Kopete 0.70.2
# BUGS: ---
# NOTES: ---
# AUTHOR: Arthur Buliva, arthurbuliva@gmail.com
# COMPANY: Mobile Planet Limited
# VERSION: 1.0
# CREATED: 26.05.2009 - 16:17:51
# REVISION: 26.05.2009
#===================================================================================
STARTUP="dcop amarok player version"
ALLOWED_AMAROK_VERSION="1.4"
ALLOWED_KOPETE_VERSION="0.70"
PIDGIN="`kopete --version`"
#Test for Amarok
a=`$STARTUP`
if [[ "$a" =~ "${ALLOWED_AMAROK_VERSION}" ]]
then
echo "Amarok $a [ OK ] "
else
echo " [ FAILED ] Make sure that you are running Amarok 1.4 `date +%b-%d-%Y\ %T` "
exit;
fi
#Test for Kopete
if [[ "$PIDGIN" =~ "${ALLOWED_KOPETE_VERSION}" ]]
then
echo "Kopete $PIDGIN [ OK ] "
else
echo "SEVERE: This script has been tested on Kopete 0.70 only `date +%b-%d-%Y\ %T` "
exit
fi
updateStatus()
{
if [[ "`$STARTUP`" != "" ]]
then
SONG_TITLE="dcop amarok player title"
ARTIST="dcop amarok player artist"
KOPETE_STATUS='qdbus org.kde.kopete /Kopete'
if [[ "`$KOPETE_STATUS`" == "" ]]
then
echo "SEVERE: Kopete is not running. This script will terminate `date +%b-%d-%Y\ %T` "
exit
fi
if [[ "`$SONG_TITLE`" != "" ]]
then
TITLE="♫ `$SONG_TITLE` by `$ARTIST`";
echo "INFO: Now listening to ♫ `$SONG_TITLE` by `$ARTIST` `date +%b-%d-%Y`";
#Pidgin
#`/usr/bin/purple-remote "setstatus?status=available&message=$TITLE"`
#Kopete
qdbus org.kde.kopete /Kopete org.kde.Kopete.setIdentityOnlineStatus "Online" "$TITLE"
sleep 5;
updateStatus
else
echo "INFO: Amarok is quiet `date +%b-%d-%Y`";
TITLE="Amarok is quiet";
#Pidgin
#`/usr/bin/purple-remote "setstatus?status=available&message=$TITLE"`
#Kopete
qdbus org.kde.kopete /Kopete org.kde.Kopete.setIdentityOnlineStatus "Online" "$TITLE"
sleep 5;
updateStatus
fi
else
echo "SEVERE: Could not connect to DCOP Server `date +%b-%d-%Y` "
exit
fi
}
updateStatus
##END