]> git.phdru.name Git - xsetbg.git/blob - xsetbg-dbus-client.py
Style: Fix `flake8` errors E302,E305 expected 2 blank lines, found 1
[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
10 def main():
11     try:
12         command = sys.argv[1]
13     except IndexError:
14         sys.exit('Usage: %s command' % sys.argv[0])
15
16     bus = dbus.SessionBus()
17     remote_object = bus.get_object("name.phdru.XSetBg", "/name/phdru/XSetBg")
18     iface = dbus.Interface(remote_object, "name.phdru.XSetBg")
19
20     getattr(iface, command)()
21
22
23 if __name__ == '__main__':
24     main()