Brightnessctl only works as root
I have two ideas, I need advice.
- Put the option in sudoers that allow brightnessctl to run as root without asking for password.
- Owning the files this program edits for changin brightness (I don't know those files).
- Any other solutions are accepted.
- Xbacklight does not work (I use wayland).
Error message I have when running it not as root:
Can't modify brightness: Permision denied. You should run this program with root privilegies. Alternatively, get write permissions for device files.
Edited 26 Mar 2020. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 1 · 100% up
- Kind
- Text
- ID
- fpklbs
9 comments
You shouldn't have to add it to sudoers. Check to make sure you have the right udev rules installed. That link is to the main development repo. Check the makefile. It sets up permissions and udev rules. Compare what it does against your system configuration.
Not sure if brightnessctl is an AUR package, but it may be behind the repo, which plays nice with modern init systems.
Let us know if this worked.
I am the brightnessctl maintainer and I agree with the comment above. Check to make sure that you have the right udev rules installed.
The udev rules are in /usr/lib/udev/rules.d/90-brightnessctl.rules
They are the same from the file in github. It was in the arch repos btw (not aur).
The error message that gives me when running it but not as root:
Can't modify brightness: Permision denied. You should run this program with root privilegies. Alternatively, get write permissions for device files.
realistically your compositor should have just taken care of this for you... enlightenment certainly does.
Sway does not. Sway is i3wm but with wayland. Extract from arch wiki https://wiki.archlinux.org/index.php/Sway#Custom_keybindings To control brightness you can use brightnessctl or light. For a list of utilities to control brightness and color correction see Backlight.
Light does not even work or display error message btw.
sway SHOULD do this. backlight is an intrinsic property of a screen. it may be achieved in many ways from literally rendering things darker, to modifying gamma and other color correction ramps to ddc i2c controls on hdmi/dp attached screens to just swizzling a /sys/.... file as some of these require matching up edid info to the screen device (ddc does), then the right place for this is in the compositor as it is its job to control the screen...
Try adding yourself to the video group. I think this is necessary for light as well. I seem to to remember that you have to logout/login again to make this change work. sudo gpasswd -a <user_name> video
This worked for me.
Deleted before we saved it.