bus = dbus.SessionBus()
proxy = bus.get_object('org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player')
player = dbus.Interface(proxy, 'org.gnome.Rhythmbox.Player')
player.connect_to_signal('playingUriChanged', playing_song_changed)
proxy = bus.get_object('org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Shell')
shell = dbus.Interface(proxy, 'org.gnome.Rhythmbox.Shell')
mainloop = glib.MainLoop()
mainloop.run()
How to continuously monitor rhythmbox for track change using python