#15: Konversation, Amarok and /media

Posted by gus on May 1, 2007 in geekery, linux, music, musings |

I wasn’t really planning to blog about this, but Theory suggested that I write about it. I guess that makes sense, in case anyone else Googles for how to do the same thing.

Last night I was experimenting with various bits of Kubuntu (which I love, by the way) and discovered the /media command in Konversation. What it essentially is really is just a script which scans your system for any known media players that are running (such as Amarok, Kaffieine or XMMS) and then outputs the name of the currently playing track to your current IRC channel.

The standard format of this message is “/me is listening to Track by Artist on Album [Media Player]” - so how it actually comes out is “webvictim is listening to Love Me Do by The Beatles on One [Amarok]“. This doesn’t really look very good, so I decided to change it.

To do this, you just edit /usr/share/apps/konversation/scripts/media and change a few values.

This is the default:

outputFormat="/me $intro $info [$player]”
formatStrings = {
Title+SelfTitled : “$title by $artist (eponymous)”,
SelfTitled : “${artist}’s self-titled album”,
Title+Artist+Album : “$title by $artist on $album”, #7,15
Title+Artist : “$title by $artist”, #6,14
Title+Album : “$title from $album”, #5,13
Album+Artist : “$album by $artist”, #3,11
Title : “$title”, #4,12
Artist : “$artist”, #2,10
Album : “$album”, #1,9
}
formatVariables={’audio’: ‘is listening to’, ‘video’: ‘is watching’}

I changed it to a much more preferable:

outputFormat="/me $intro $info"
formatStrings = {
Title+SelfTitled : "$artist - $title (eponymous)",
SelfTitled : "${artist}'s self-titled album",
Title+Artist+Album : "$artist - $title [album: $album]“, #7,15
Title+Artist : “$artist - $title”, #6,14
Title+Album : “$title [album: $album]“, #5,13
Album+Artist : “$artist [album: $artist]“, #3,11
Title : “$title”, #4,12
Artist : “$artist”, #2,10
Album : “$album”, #1,9
}
formatVariables={’audio’: ‘listens to’, ‘video’: ‘watches’}

So now, my /media string comes up as “webvictim listens to The Beatles - Love Me Do [album: One]” - which I think is far nicer.

1 Comment

Lowe
Aug 4, 2007 at 5:58pm

How would one go about including the bitrate?


 

Reply

Copyright © 2009 webvictim.net All rights reserved. Theme by Laptop Geek.