push
This commit is contained in:
20
contrib/cmus-updatepidgin.py
Normal file
20
contrib/cmus-updatepidgin.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import dbus
|
||||
import sys
|
||||
|
||||
args = {}
|
||||
|
||||
for n in range(1, len(sys.argv) - 1, 2):
|
||||
args[sys.argv[n]] = sys.argv[n + 1]
|
||||
|
||||
obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
|
||||
pidgin = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
|
||||
|
||||
current = pidgin.PurpleSavedstatusGetCurrent()
|
||||
status_type = pidgin.PurpleSavedstatusGetType(current)
|
||||
saved = pidgin.PurpleSavedstatusNew("", status_type)
|
||||
pidgin.PurpleSavedstatusSetMessage(saved, "♪ %s - %s" % (args["artist"], args["title"]))
|
||||
pidgin.PurpleSavedstatusActivate(saved)
|
||||
|
||||
Reference in New Issue
Block a user