]> git.phdru.name Git - xsetbg.git/blob - xsetbg-dbus.py
Version 5.0.2
[xsetbg.git] / xsetbg-dbus.py
1 #! /usr/bin/env python
2 """XSetBg (DBus version)
3
4 """
5
6 __author__ = "Oleg Broytman <phd@phdru.name>"
7 __copyright__ = "Copyright (C) 2000-2012 PhiloSoft Design"
8 __license__ = "GNU GPL"
9
10 import gobject
11
12 import dbus
13 import dbus.service
14 import dbus.mainloop.glib
15
16 from xsetbg import change
17
18
19 class XsetBg(dbus.service.Object):
20
21     @dbus.service.method("name.phdru.XSetBg", in_signature='', out_signature='')
22     def change(self):
23         change()
24
25     @dbus.service.method("name.phdru.XSetBg", in_signature='', out_signature='')
26     def force(self):
27         change(force=True)
28
29     @dbus.service.method("name.phdru.XSetBg", in_signature='', out_signature='')
30     def stop(self):
31         mainloop.quit()
32
33
34 if __name__ == '__main__':
35     dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
36
37     session_bus = dbus.SessionBus()
38     name = dbus.service.BusName("name.phdru.XSetBg", session_bus)
39     object = XsetBg(session_bus, '/name/phdru/XSetBg')
40
41     change(force=True)
42     mainloop = gobject.MainLoop()
43     mainloop.run()