Skip to content

Instantly share code, notes, and snippets.

@jacekmitrega
Last active August 29, 2015 14:18
Show Gist options
  • Save jacekmitrega/a94fefc041da8288f466 to your computer and use it in GitHub Desktop.
Save jacekmitrega/a94fefc041da8288f466 to your computer and use it in GitHub Desktop.
Jolla :: setAmbience
#!/usr/bin/env python
import sys
ambience_name = sys.argv[1]
import dbus, dbus.proxies
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
obj_proxy = dbus.proxies.ProxyObject(conn=bus, bus_name='com.jolla.ambienced', object_path='/com/jolla/ambienced')
intf_proxy = dbus.proxies.Interface(obj_proxy, 'com.jolla.ambienced')
setAmbience = intf_proxy.get_dbus_method('setAmbience')
setAmbience('file:///usr/share/ambience/{name}/{name}.ambience'.format(name=ambience_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment