Ah, it’s so difficult to be a fucking genius…I don’t know how I manage. 😀

Someone else fixed the Music plugin for aMSN so that it had support for Rhythmbox, and since I do use Rhythmbox as my “music manager”, that was fine, but when I just want a player, I use Audacious. The plugin has support for XMMS, but I don’t use that anymore, and really don’t want to use it, and especially don’t want to change my default application for opening music files.

I looked around a bit and found that I wasn’t the only one who wanted to use Audacious with the plugin, and someone thoughtfully provided the code for a script that should work. Being a goddamned genius, I knew all I had to do was copy/paste it into a new file, save it in the Music plugin directory in .amsn, and set it executable. Works perfectly, and when I upgrade and forget that I have a custom addition to the plugin, the code is this:

#! /bin/sh
# Shell script to get informations about the current song playing in Audacious

#Audacious is launched ?
STATUS=$(audtool playback-status)
VERSION=$(audtool get-version)

if [ $? = 0 ]
then
echo $STATUS
MAJ=`expr substr ${VERSION#A*\ } 1 1`
MIN=`expr substr ${VERSION#A*\ } 3 1`

if [ “$MAJ” -eq “1” -a “$MIN” -ge “4” ] || [ “$MAJ” -gt “1” ]
then
#To force \n when there isn’t any information
echo $(audtool current-song-tuple-data title)
echo $(audtool current-song-tuple-data artist)
else
#To force \n when there isn’t any information
echo $(audtool current-song-tuple-data track_name)
echo $(audtool current-song-tuple-data performer)
fi
audtool current-song-filename
else
echo 0
fi

exit 0

Does anyone on my contact list really care what I’m listening to? Probably not, but that isn’t the point. The point is the ability to customise and configure, add stuff and remove stuff, and hopefully not break anything beyond repair, until the result is what I want. Why? Well, because I’m a computer control freak, of course! 🙂