Current song in mail signature

I use XMMS for playing all my mp3s and oggs; and I like it to have the currently played song appended to my email signature.

For this purpose I have 2 files:

  • One template file with the signature text to which the song title is appended

    Example 2.6. /home/cweiske/Documents/mailsignature_song.txt

    Christian Weiske
    XMMS is playing now:
  • A script, which appends the song title to the template and saves it as the final signature file

    Example 2.7. /home/cweiske/scripts/mailsignature_song.sh

    cat /home/cweiske/Documents/mailsignature_song.tpl > /home/cweiske/Documents/mailsignature_song.txt
    echo $1 >> /home/cweiske/Documents/mailsignature_song.txt
  • And the resulting file is set as signature in thunderbird

    Example 2.8. /home/cweiske/Documents/mailsignature_song.txt

    Christian Weiske
    XMMS is playing now:
    Christina Aguilera - Impossible

Now all I did was to use the songchange plugin in XMMS to call the mailsignature_song.sh script every time a new title is played.

Broadcasting the song information with icecast

I use icecast in connection with XMMS to broadcast the currently played song over the network to have control about what is played at the computer with the sound system at work...

One doesn't need to do this, but it is a nice feature to see the song title and author in the remote player. Once again I used the songchange plugin for XMMS to write title and author into a file

Example 2.9. /home/cweiske/scripts/xmms_icecast.pl

@trackinfo=split(/ - /, $ARGV[0]);
system("echo \"TITLE=$trackinfo[1]\" > /home/cweiske/trackinfo.txt");
system("echo \"ARTIST=$trackinfo[0]\" >> /home/cweiske/trackinfo.txt");
system("killall -USR1 ices");


I didn't write this script; it is from the icecast website.

Now there are 2 scripts which are to be called by the songchange plugin, and as this can call only one script, there is a third one to call those two (nice sentence, isn't it?)

Example 2.10. /home/cweiske/scripts/xmms_songtitle

/home/cweiske/scripts/xmms_icecast.pl "$1"
/home/cweiske/scripts/mailsignature_song.sh "$1"