a guest Mar 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- '''Cycles keyboard brightness levels using DBus.'''
- import dbus
- def main():
- bus = dbus.SystemBus()
- proxy = bus.get_object('org.freedesktop.UPower',
- interface = dbus.Interface(proxy, 'org.freedesktop.UPower.KbdBacklight')
- current_level = interface.GetBrightness()
- max_level = interface.GetMaxBrightness()
- interface.SetBrightness((current_level+1) % (max_level+1))
- if __name__ == "__main__":
RAW Paste Data