Created
February 11, 2013 07:44
-
-
Save rbrito/4753151 to your computer and use it in GitHub Desktop.
Script to control monitor brightness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Python script to essentially perform the same as: | |
gdbus call \ | |
--session \ | |
--dest org.gnome.SettingsDaemon \ | |
--object-path /org/gnome/SettingsDaemon/Power \ | |
--method org.gnome.SettingsDaemon.Power.Screen.SetPercentage 75 | |
References: | |
http://ask.fedoraproject.org/question/980/brightness-applet-on-gnome-panel | |
http://en.wikibooks.org/wiki/Python_Programming/Dbus | |
http://www.devtech.com/inhibitapplet | |
""" | |
if __name__ == '__main__': | |
import dbus | |
session_bus = dbus.SessionBus() | |
proxy = session_bus.get_object("org.gnome.SettingsDaemon", | |
"/org/gnome/SettingsDaemon/Power") | |
dbus_int = dbus.Interface(proxy, "org.gnome.SettingsDaemon.Power.Screen") | |
set_percentage = dbus_int.get_dbus_method("SetPercentage") | |
set_percentage(40) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment