]> git.phdru.name Git - xsetbg.git/blob - xsetbg-dbus-client.py
Feat(DB): Add column `is_image`
[xsetbg.git] / xsetbg-dbus-client.py
1 #!/usr/bin/env python
2 """XSetBg DBus client
3
4 """
5
6 import sys
7 import dbus
8
9 def main():
10     try:
11         command = sys.argv[1]
12     except IndexError:
13         sys.exit('Usage: %s command' % sys.argv[0])
14
15     bus = dbus.SessionBus()
16     remote_object = bus.get_object("name.phdru.XSetBg", "/name/phdru/XSetBg")
17     iface = dbus.Interface(remote_object, "name.phdru.XSetBg")
18
19     getattr(iface, command)()
20
21 if __name__ == '__main__':
22     main()