]> git.phdru.name Git - xsetbg.git/blob - xsetbg-dbus-client.py
DBus - done.
[xsetbg.git] / xsetbg-dbus-client.py
1 #!/usr/bin/env python
2 """XSetBg DBus client
3
4 """
5
6 __version__ = "$Revision: 48 $"[11:-2]
7 __revision__ = "$Id: xsetbg-wsgi.py 48 2011-02-18 13:35:39Z phd $"[5:-2]
8 __date__ = "$Date: 2011-02-18 16:35:39 +0300 (Fri, 18 Feb 2011) $"[7:-2]
9
10 __author__ = "Oleg Broytman <phd@phdru.name>"
11 __copyright__ = "Copyright (C) 2000-2010 PhiloSoft Design"
12 __license__ = "GNU GPL"
13
14
15 import sys
16 import dbus
17
18 def main():
19     try:
20         command = sys.argv[1]
21     except IndexError:
22         sys.exit('Usage: %s command' % sys.argv[0])
23
24     bus = dbus.SessionBus()
25     remote_object = bus.get_object("name.phdru.XSetBg", "/XSetBg")
26     iface = dbus.Interface(remote_object, "name.phdru.XSetBg")
27
28     getattr(iface, command)()
29
30 if __name__ == '__main__':
31     main()