Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] chgrp / chmod brightness so xbacklight works
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
o5gmmob8
Guru
Guru


Joined: 17 Oct 2003
Posts: 531

PostPosted: Tue Feb 11, 2025 1:01 pm    Post subject: [SOLVED] chgrp / chmod brightness so xbacklight works Reply with quote

I installed acpilight and changed the permissions on the file:

/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness

to be :video
664

That seems a bit hackish, is there a better way to do it?


Last edited by o5gmmob8 on Wed Feb 12, 2025 4:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 716

PostPosted: Tue Feb 11, 2025 5:03 pm    Post subject: Reply with quote

Quote:
That seems a bit hackish, is there a better way to do it?
Adding a udev rule to set the mode and group owner on "add" would be using udev "as intended", but for something that only gets added once local.d is much less work...
Back to top
View user's profile Send private message
o5gmmob8
Guru
Guru


Joined: 17 Oct 2003
Posts: 531

PostPosted: Tue Feb 11, 2025 5:08 pm    Post subject: Reply with quote

Fair point.

That device is 'added' every time the system boots, though, right? Is that what you're proposing then, or were you completely advocating for hard-coding the path?

Code:
find /sys/devices/ -type f -path '*/*_backlight/brightness' -exec chmod 664 {} +
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 716

PostPosted: Wed Feb 12, 2025 12:34 pm    Post subject: Reply with quote

o5gmmob8 wrote:
That device is 'added' every time the system boots, though, right?
Yep
Quote:
Is that what you're proposing then?
Yeah, my udev-foo is weak, it takes me forever to make them work, but by combining two rules I have that do work with the info you've provided
/etc/udev/rules.d/XY-backlight-permissions.rules:
DEVPATH=="/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness", ACTION=="add", MODE="0664", GROUP="video"
should* work. If the path is wont to change then you can glob parts of it so "/devices/pci*intel_backlight/brightness" should also match.

*I've only ever used DEVPATH== to run scripts on certain devices being added, but MODE and GROUP directives should work as far as I know.
Back to top
View user's profile Send private message
o5gmmob8
Guru
Guru


Joined: 17 Oct 2003
Posts: 531

PostPosted: Wed Feb 12, 2025 4:45 pm    Post subject: Reply with quote

I agree with you, there isn't a singular way to do this and for me, udev rules are much less understood by me than cron or local.d. So, I will heed your advice and put this in /etc/local.d. I believe for some reason I historically put startup scripts in crontab for some reason and that requires slightly more complexity because you must specify @reboot. Then, if cron isn't running, it becomes a bit more involved to troubleshoot.

It'd just be easier to drop it in /etc/local.d and be done with it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum