I am using Manjaro LXQt for a while now. My laptop is a Sony VAIO SVS13112ENB with Intel i915 graphics. The brightness keys wouldn’t work out of the box. To fix it I used the same scripts from Ubuntu and attached them to the brightness up/down keys. Those worked but I noticed two more issues with the procedure.
- After I blank my screen using
$ xset dpms force off
my brightness would reset to maximum when the monitor is turns on.
- While the scripts from the earlier procedure set the brightness level, as reported by
$cat /sys/class/backlight/intel_backlight/brightness
the backlight stays at 100 as reported by:
$ xbacklight
However, both these problems gets fixed if I use xbacklight to set the backlight level. The brightness wouldn’t reset and both backlight and brightness levels would change with different values set by xbacklight. As an additional bonus, it can be run as a regular user.
Another point to notice here is xbacklight actually sets the level at a fractional value, though you pass an integer.
Find the modified scripts using xbacklight below.
br+
#!/bin/bash #increase monitor brightness curval=`xbacklight` curval=${curval%.*} curval=$(expr $curval + 1) if [ $curval -ge 50 ]; then echo already max else xbacklight -time 1 -set `echo $(expr $curval + 2)` fi
br-
#!/bin/bash #decrease monitor brightness curval=`xbacklight` curval=${curval%.*} curval=$(expr $curval + 1) if [ $curval -le 4 ]; then echo already min else xbacklight -time 1 -set `echo $(expr $curval - 2)` fi
If nothing else works, you can use my patched version of xtrlock. Modify your screen blanking script as:
#!/bin/bash xset dpms force off xtrlock -c "xbacklight -set 20" -b
After blanking, the script calls xtrlock to lock your screen. xtrlock sets the backlight to 20 (change it to your preferred value) before exiting.