I'm facing this issue on ubuntu 20.10 with i3 window manager: in i3 I found this workaround to change the screen brightness with a little .sh script:

echo -n "Enter brightness: "
read brightness
echo "$brightness" > /sys/class/backlight/intel_backlight/brightness

The problem is that it requires sudo, and it doesen't fix changing the sudoers.d file or with sudo visudo, so the only way to avoid using sudo every time is by giving this command:

sudo chown username:username /sys/class/backlight/intel_backlight/brightness

and then it works fine without sudo. But every time i boot my system the brightness file's ownership goes back to root. Is there a way I can allways maintain this change?

I tried other solutions for controlling brightness in i3, such as xbacklight or light, but the first doesen't work at all, while with light i have the same sudo problem.


You can try ybacklight

git clone https://github.com/szekelyszilv/ybacklight

cd ybackight

mkdir build; meson build; cd build; ninja install

ybacklight -get 

sudo ybacklight -set 20 

Also, you can modify your sudoers file to run ybacklight without sudo: https://unix.stackexchange.com/questions/18830/how-to-run-a-specific-program-as-root-without-a-password-prompt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.