autolux - intelligent screen brightness
autolux is a python program that automatically adjusts the brightness of the monitor based on the actual content on the monitor. its similar to f.lux, but instead of adjusting the hue based on the time of day, it adjusts the brightness based on the screen content.
it’s meant to prevent the eye fatigue caused by switching between a dark window (like the terminal) and a bright window (like the web browser). it was inspired by lumen but written for linux.
it uses a combination of xdotool
, xbacklight
and imagemagick
to monitor
when the current window or workspace changes and calculate the current content
whiteness. these values will inform the brightness that the monitor should
change to.
autolux uses a simple learning model: when the user manually adjusts the brightness, the program takes note of what the current screen whiteness is and the time of day and keeps track of the most recent brightness values. when the window changes, we use the time of day and current monitor whiteness values to figure out what the new output brightness should be.
the idea is that the brightness the user wants will be based on the time of day + the content on the screen. below is an image showing how the anticipated brightness changes by time of day for me.
from roughly 9am - 3pm, when the sun is out, my monitor has its highest brightness output. after 3pm, lumen starts using a lower brightness setting until 9pm - 3am, when the brightness output tends to be at its lowest value.
the way i measure success for autolux is based on how often I need to manually adjust the monitor’s brightness on a given day. a complete success will be never having to manually adjust the brightness.
after using autolux for a couple years, i can’t imagine going back to using a monitor without adaptive brightness.