Document cmus-remote -Q
[cmus.git] / contrib / cmus-updatepidgin.py
blob7d1c7ac8ff4d773d8c05df8f61abf1d49f702f26
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
4 import dbus
5 import sys
7 args = {}
9 for n in range(1, len(sys.argv) - 1, 2):
10 args[sys.argv[n]] = sys.argv[n + 1]
12 print args
14 bus = dbus.SessionBus()
16 obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
17 pidgin = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
19 current = pidgin.PurpleSavedstatusGetCurrent()
20 status_type = pidgin.PurpleSavedstatusGetType(current)
21 saved = pidgin.PurpleSavedstatusNew("", status_type)
22 pidgin.PurpleSavedstatusSetMessage(saved, "♪ %s - %s" % (args["artist"], args["title"]))
23 pidgin.PurpleSavedstatusActivate(saved)