Adaptive backlight daemon, using camera as light sensor.
- smooth backlight adaptation
- start with delay
- one-time mode
- auto-restart on configuration file change
- set maximum light to current by SIGUSR2 signal
- effective: up to 30fps for camera input without notable performance losses
- no need for systemd or X, though xbacklight may be used
- ncurses - for colored output
- util-linux - use hexdump instead of od
- inotify-tools - to auto-restart on configuration change
Note: It will tell when necessary tools are missing.
Type backlight-adaptive -h
to see all options.
Run with default settings
$ backlight-adaptive
Toggle running
$ backlight-adaptive -t
Match backlight once to current light level and quit.
$ backlight-adaptive -1
Update maximum light level to current
$ backlight-adaptive --calibrate
Update configuration with command line options included
$ backlight-adaptive --update-conf
Backlight can change smoothly by using multiple box filter stages. Box filters are effective at any buffer length, and 3 of them are enough to get result, comparable by quality with gaussian or cubic spline. Buffer sizes are specified independently for each filter in form of comma-separated number list (no spaces).
Use short anti-fluctuation filter
$ backlight-adaptive --smooth 6,6
Slow accomodation filter
$ backlight-adaptive --smooth 120,120,20
Note: Two equally sized filters seem to be most optimal setup.
Lone one makes linear transition for lone jump between two stable levels, but for short fluctuation it will be just small but constant change for all duration. 2nd filter turns it to linear fade on and off. This should be enough for usable result - for stable change it makes smooth result. 3rd filter smoothes even shortest fluctuations, but each extra stage adds latency between light change and visible backlight reaction.
Configuration file is automatically created if no other file exists and writeable config directory is found. Further update may be forced with --update-conf or -u command line option.
- $XDG_CONFIG_DIR
- ~/.config
- /etc
- SIGUSR1 - reload configuration
- SIGUSR2 - update maximum light level to current
Following steps are necessary for internal ACPI backend to work.
- Place 90-backlight.rules into /etc/udev/rules.d or /lib/udev/rules.d to enable write permissions for internal ACPI backend (requires reboot).
- Make sure, that you are in video group (requires relogin).
Note: other tools like acpilight or light may have it already done.
Shell script only makes configuration, all dirty job is done by persistant ffmpeg-based pipeline.
See more backlight utilities