Created
September 29, 2010 07:04
-
-
Save edrex/602388 to your computer and use it in GitHub Desktop.
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 | |
# quickly toggle between brightness levels | |
# put this in your path and run it using a gnome keyboard shortcut | |
# i have it bound to Ctrl-F5 | |
import dbus | |
bus=dbus.SessionBus() | |
proxy=bus.get_object('org.gnome.PowerManager','/org/gnome/PowerManager/Backlight') | |
cl = int(proxy.GetBrightness(dbus_interface='org.gnome.PowerManager.Backlight')) | |
if cl < 20: | |
nl = 30L | |
elif cl < 90: | |
nl = 100L | |
else: | |
nl = 1L | |
proxy.SetBrightness(dbus.UInt32(nl), dbus_interface='org.gnome.PowerManager.Backlight') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment