+++ /dev/null
-#!/usr/bin/env python
-"""XSetBg DBus client
-
-"""
-
-import sys
-import dbus
-
-
-def main():
- try:
- command = sys.argv[1]
- except IndexError:
- sys.exit('Usage: %s command' % sys.argv[0])
-
- bus = dbus.SessionBus()
- remote_object = bus.get_object("name.phdru.XSetBg", "/name/phdru/XSetBg")
- iface = dbus.Interface(remote_object, "name.phdru.XSetBg")
-
- getattr(iface, command)()
-
-
-if __name__ == '__main__':
- main()
+++ /dev/null
-#! /usr/bin/env python
-"""XSetBg (DBus version)
-
-"""
-
-import gobject
-
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-
-from xsetbg import change
-
-
-class XsetBg(dbus.service.Object):
-
- @dbus.service.method("name.phdru.XSetBg",
- in_signature='', out_signature='')
- def change(self):
- change()
-
- @dbus.service.method("name.phdru.XSetBg",
- in_signature='', out_signature='')
- def force(self):
- change(force=True)
-
- @dbus.service.method("name.phdru.XSetBg",
- in_signature='', out_signature='')
- def stop(self):
- mainloop.quit()
-
-
-if __name__ == '__main__':
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
- session_bus = dbus.SessionBus()
- name = dbus.service.BusName("name.phdru.XSetBg", session_bus)
- object = XsetBg(session_bus, '/name/phdru/XSetBg')
-
- change(force=True)
- mainloop = gobject.MainLoop()
- mainloop.run()