]> git.phdru.name Git - xsetbg.git/blobdiff - xsetbg-dbus-client.py
xsetbg (DBus version).
[xsetbg.git] / xsetbg-dbus-client.py
diff --git a/xsetbg-dbus-client.py b/xsetbg-dbus-client.py
new file mode 100644 (file)
index 0000000..7d2e337
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+"""XSetBg DBus client
+
+"""
+
+__version__ = "$Revision: 48 $"[11:-2]
+__revision__ = "$Id: xsetbg-wsgi.py 48 2011-02-18 13:35:39Z phd $"[5:-2]
+__date__ = "$Date: 2011-02-18 16:35:39 +0300 (Fri, 18 Feb 2011) $"[7:-2]
+
+__author__ = "Oleg Broytman <phd@phdru.name>"
+__copyright__ = "Copyright (C) 2000-2010 PhiloSoft Design"
+__license__ = "GNU GPL"
+
+
+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", "/XSetBg")
+    iface = dbus.Interface(remote_object, "name.phdru.XSetBg")
+
+    getattr(iface, command)()
+
+if __name__ == '__main__':
+    main()