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. acpi_video0
, intel_backlight
) :
% 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.
usermod -aG video <user>
After that this should work:
echo 5 > /sys/class/backlight/<vendor>/brightness
The reason that this is set at su permissions is that a virus could conceivably make your screen dim and go bright at incredible speed ultimately damaging your hardware display. In the 90's I encountered a virus that would adjust the screen refresh Hertz so rapidly that your monitor would fry.