Change "brightness" file permission permanently

3 replies [Last post]
solnik10
Offline
Joined: 05/30/2012

Hi, the only way I can change the brightness on my HP 23 All In One is modifying the file /sys/class/backlight/intel_backlight. It works great, but the thing is that I want to change it without being root or using sudo. I've successfully changed its permission and wrote a script so every user could change the brightness using a keyboard shortcut. It works perfectly fine until I reboot the system....then the permissions get back to normal. Is there a way to change the permission of this file permanently or can anyone suggest another workaround. I've already tried xbacklight and setpci (sudo setpci -s "00:02.0" F4.B=XX) without success. Thanks in advance!

lembas
Offline
Joined: 05/13/2010

You can include the chown command to the system startup scripts that get run as root.

The default runlevel is 2 and the related scripts are in /etc/rc2.d

Read the README in that directory and go from there. Use one of the existing scripts as a template, or even just append the command to one of them.

(And yes it's a stupid or at least complex and user hostile system but that's what we seem to be using at the moment...)

solnik10
Offline
Joined: 05/30/2012

thank you! I've fixed adding chmod 777 /sys/class/backlight/intel_backlight to the /etc/rc.local file. do you think this a good option?

lembas
Offline
Joined: 05/13/2010

I think if it works then it's great! :)

It's a good idea to document such changes somewhere, in case you need to change them or reinstall the system or whatever.