View previous topic :: View next topic |
Author |
Message |
o5gmmob8 Guru

Joined: 17 Oct 2003 Posts: 539
|
Posted: Tue Feb 11, 2025 1:01 pm Post subject: [SOLVED] chgrp / chmod brightness so xbacklight works |
|
|
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 |
|
 |
Ralphred l33t

Joined: 31 Dec 2013 Posts: 725
|
Posted: Tue Feb 11, 2025 5:03 pm Post subject: |
|
|
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 |
|
 |
o5gmmob8 Guru

Joined: 17 Oct 2003 Posts: 539
|
Posted: Tue Feb 11, 2025 5:08 pm Post subject: |
|
|
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 |
|
 |
Ralphred l33t

Joined: 31 Dec 2013 Posts: 725
|
Posted: Wed Feb 12, 2025 12:34 pm Post subject: |
|
|
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 |
|
 |
o5gmmob8 Guru

Joined: 17 Oct 2003 Posts: 539
|
Posted: Wed Feb 12, 2025 4:45 pm Post subject: |
|
|
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 |
|
 |
|