I often use my computer in text-only mode, so no X11, no window manager, etc. I'd like to be able to adjust the screen brightness of my laptop while in text mode, which I can do by writing to the file


In order to write to the file, I either run the command through sudo or change the permissions for the brightness file.

I'd like to write a script which will change the brightness by increments, for which I would need permanent write access to the brightness file. Unfortunately, since it's in /sys, it's generated dynamically every time I boot up, so I need to change the file's permissions every time I restart.

I gather that I can change the permissions permanently by writing a udev rule, which I've never done before. Would that be the best way to achieve what I'm trying to do, or is there a safer alternative? For example, putting something in rc.local, using cron, etc.

  • udev rules are more complex than a single echo command in rc.local. You seem to already know the answer to your own question, more or less. – Larssend Jul 18 '15 at 4:35

I would use the rc.local method simply because it is easier and simpler than writing and maintaining a custom udev rule. You might also have to write a script that re-applies the permissions upon resuming from suspend and hibernation. Such script should be put in /etc/pm/sleep.d/ (requires pm-utils), if needed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.