As written in the Arch wiki (link), by default, only
root can change the brightness by this method. To allow users in the
video group to change the brightness, a
udev rule such as the following can be used (replace the
<vendor> with your vendor id. E.g.
% cat /etc/udev/rules.d/backlight.rules
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="<vendor>", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="<vendor>", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
Then you need to add your user to the
video group. After that this should work:
echo 5 > /sys/class/backlight/<vendor>/brightness