GNOME Bugzilla – Bug 369754
Display playing song information in Gaim
Last modified: 2010-01-03 08:35:21 UTC
I'm one of those people that really appreciates the WMP plugin for MSN Messenger - it's nice to able to see what you and your friends are listening to. It would be fantastic to have this feature available for Rhythmbox/Gaim as well. The Amarok guys have already written a plugin for their player which does exactly this, available here: http://www.kde-apps.org/content/show.php?content=48025
The version of gaim I have (2.0b3) doesn't have the necessary DBus methods to do this. But something like the following code (in a plugin) should work: def activate (self, shell): self.shell = shell self.pec_id = sp.connect ('playing-song-changed', self.playing_entry_changed) self.pc_id = sp.connect ('playing-changed', self.playing_changed) bus = dbus.SessionBus() obj = bus.get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject") gaim = dbus.Interface(obj, "net.sf.gaim.GaimInterface") status_name = "Media" self.status = gaim.GaimSavedstatusFind(status_name) if self.status == 0: current = gaim.GaimSavedstatusGetCurrent() status_type = gaim.GaimSavedstatusGetType(current) self.status = gaim.GaimSavedstatusNew(status_name, status_type) self.default = gaim.GaimSavedstatusGetCurrent() playing_changed(shell, shell.props.shell_player) def deactivate (self, shell): set_entry (self, None) self.shell = None sp.disconnect (self.pec_id) sp.disconnect (self.pc_id) def playing_changed (self, sp, playing): self.set_entry(sp.get_playing_entry ()) def playing_entry_changed (self, sp, entry): self.set_entry(entry) def set_entry (self, entry): if (entry): db = self.shell.props.db artist = db.get(entry, rhythmdb.PROP_ARTIST) title = db.get(entry, rhythmdb.PROP_TITLE) message = "%s - %s" % (artist, title) self.gaim.GaimSavedstatusSetMessage(self.status, message) self.gaim.GaimSavedstatusActivate(self.status) else: self.gaim.GaimSavedstatusActivate(self.default)
This was implemented in the IM status plugin recently. *** This bug has been marked as a duplicate of bug 605023 ***