baumi's blog

baumi's personal blog … Linux, OS X, Windows, Random things, …

GNU/Linux Elementary OS “Freya”: custom brightness indicator, exponential brightness control


this works nicely, however my personal taste is to have more precise control over low brightness settings. therefore i’ve adjusted the script to do exponential brightness. the two changed functions are in /opt/, changes in bold:

def set_brightness(brightness):
    bbb = int(brightness) * int(brightness) / max_brightness['pkexec','/usr/lib/gnome-settings-daemon/gsd-backlight-helper','--set-brightness',"%s" % bbb])


def get_curr_brightness():
    c = 0
        p = subprocess.Popen(['pkexec','/usr/lib/gnome-settings-daemon/gsd-backlight-helper','--get-brightness'], stdout=subprocess.PIPE)
        curr_brightness = float(p.communicate()[0])
        curr_brightness = int( ((curr_brightness/max_brightness)**0.5) * max_brightness)
        c = closest(curr_brightness, brightness_settings)
        c = 0
    return brightness_settings.index(c)

Comments are currently closed.