Please support VectorLinux!

Author Topic: HOWTO: xmms/audacious autochange gaim status  (Read 2073 times)

stoichyu

  • Packager
  • Vectorite
  • ****
  • Posts: 369
HOWTO: xmms/audacious autochange gaim status
« on: January 21, 2007, 08:28:09 am »
xmms/audacious has a nice plugin, song_change which executes a script everytime the song changes. This can be used to for example to update your gaim status with the current song. Note: This requires gaim2.0.0beta and dbus to work.

1. Make a script with the following. 'mousepad songchange.sh'
Code: [Select]
#!/bin/sh

#get params
SONG=$1

#get status from gaim
CURR_STATUS_INDEX=$(expr match "$(gaim-send GaimSavedstatusGetCurrent)" '.*int32 \([0-9]*\)')
CURR_STATUS=$(expr match "$(gaim-send GaimSavedstatusGetMessage int32:$CURR_STATUS_INDEX)" '.*string "\(.*\)"')
STATUS=$(expr match "$CURR_STATUS" "\-\[\(.*\)\]\-")

#set status
gaim-send GaimSavedstatusSetMessage int32:$CURR_STATUS_INDEX string:"-[$STATUS]- $SONG"
gaim-send GaimSavedstatusActivate int32:$CURR_STATUS_INDEX

2. Make it executable, 'chmod a+x songchange.sh'
3. In xmms/audacious, enable the songchange plugin and in the command box put
Code: [Select]
<path to script>/songchange.sh "%s"4. In gaim, go to tools->plugins and enable dbus example
5. In gaim, put your status inside -[  ]- ex.
Quote
-[ using xmms-songchange ]- SimCity 4 - Rush Hour
6. Enjoy :D

Note: It is possible to change the delimiter(in case your song titles  have ']-') or move some stuff around accdg to your preference.
There's no place like ~.
VL 5.8 PentiumD 2.8Ghz Registered Linux User #432836