Why ? Because redshift
mess things up and override most system backlight control. And because it is useless to have a color shift with a full bright monitor, we have to use another approch to control brightness.
Also, most windows mananger like gnome or kde might provide some way to control color shift and brightness, it is not always true with more lightweight wm (I use i3
and it does not give such control natively since it is a wm and not a gaz factory).
How ? This soft, registered as a service, provide a control to the file responsible to set the brightness value of the monitor (thanks to unix, most configration, even low level ones, are done using files).
just run :
chmod +x install.sh
sudo ./install.sh
sudo systemctl enable native-backlight.service
sudo systemctl start native-backlight.service
and that's all. Now you can have control the brightness using:
# increase the brightness
/opt/native-backlight/bin/nb-client.py increase
# decrease the brightness
/opt/native-backlight/bin/nb-client.py decrease
# reset to default / max value
/opt/native-backlight/bin/nb-client.py reset
the few things you might haev a look:
port
: set the communcation port. Since it use a client/server architecture to manage system file without tempering with access right, it must communicate through a port. Pick the one you wantmax
: the max brightness value. Mandatory since, if you put too high value in the brightness system file, you will get an errordefault
: the standart birghtness you want. Most of the time, it should be the same as maxthreshold
: the minimum time in ms between two brightness changestep
: the value used to increase or decrease the brightness. Low value will bring a more precise control. If you put low value, you should also decrease thethreshol
in order to have a smoother experiencebrightness_file
: the file used by linux to contorl brithness.
to bind the control command to keyboard shortcut, I had to put those two lines in my i3/config
file :
bindsym XF86MonBrightnessDown exec "/opt/native-backlight/bin/nb-client.py decrease"
bindsym XF86MonBrightnessUp exec "/opt/native-backlight/bin/nb-client.py increase"
the key name has been found using xev
to show X events.
Right now, it is more a (usasable) proof of concept than a full feature soft. It might show limitation:
- with multiple monitor. I will adapt it if requested or if I, myself, feel the need.
- with a
default
value different than themax
value. It will start with themax
brightness unless the command/opt/native-backlight/bin/nb-client.py reset
is launched. - wayland... it shouldn't make any difference, either wayland or X, but I didn't test it, so I can't be sure.
- other not known ?