Skip to content

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.

1 points7 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
1 · 100% up
Kind
Text
ID
fpklbs

Author

9
posts
28
comments
2
media
View profile

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.

6 points

I am the brightnessctl maintainer and I agree with the comment above. Check to make sure that you have the right udev rules installed.

5 points

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.

2 points

realistically your compositor should have just taken care of this for you... enlightenment certainly does.

1 points

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.

1 points

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...

1 points

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

1 points
unknown author

Deleted before we saved it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.