Ubuntu 20 udev rules not working
I did sudo apt install brightnessctl, but it seems for Ubuntu 20 LTS that although udev rules get copied to /lib/udev/rules.d/ as desired in the debian install routine, it is not possible to use brigthnessctl without sudo.
Can you show me the installed rules and the output of your id command?
sure .. and I am very confident that my user is the default user created during OS installation, so no special tweaks in regards of group membership.
$ id
uid=1000(itler) gid=1000(itler) groups=1000(itler),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare),998(docker)
$ cat /lib/udev/rules.d/90-brightnessctl.rules
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chgrp input /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chmod g+w /sys/class/leds/%k/brightness"
$ brightnessctl s 20%+
Can't modify brightness: Permission denied
You should run this program with root privileges.
Alternatively, get write permissions for device files.
$ ls -la /sys/class/backlight/intel_backlight/brightness
-rw-rw-r-- 1 root video 4096 Mar 2 08:11 /sys/class/backlight/intel_backlight/brightness
Ah, I am blind. Yes that could be the reason. Maybe GIDs changed in Ubuntu20
The easiest way to fix it would be to add yourself to the video group via usermod -aG video ${USER} or something similar.
Sure no worries. Just wondering if this is a generic problem on Ubuntu 20 to be dealt with or some specifics to my machine. Anyways, thanks for supporting. Feel free to close this issue if not needed anymore.
I am running with that same problem but I am unable to use the program without using sudo. My user is nelson and it is the only user on the system. I am using Elementary which follows the Ubuntu 18.04LTS
$ cat /etc/group | grep video
video:x:44:nelson
$ cat /etc/group | grep input
input:x:104:nelson
$ cat /lib/udev/rules.d/90-brightnessctl.rules
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chgrp input /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chmod g+w /sys/class/leds/%k/brightness"
sudo usermod -aG video ${USER} and rebooting fixed my issue. For a temporary solution you can change permissions of /sys/class/backlight/%k/brightness from other=read to other=read+write. Just remember the permissions will be reverted after a reboot.
sudo usermod -aG video ${USER}
This indeed fixed it for me, could it be made clearer in the readme or error message? (that you may need to add current user to video and input)