LightScript is a script used to control a screens backlight brightness, it is lightweight, zlib-licensed and written by Fredrik Haikarainen.
LightScript is a "light" (read minimal) script that does one thing and does that thing well; Sets the screen brightness based off a value given in percent. It has the following features:
- Automatically finds the controller with the best resolution, and uses it to set the brightness.
- If sudo is installed, it attempts to use it. Since the script needs root, I thought it would be nice to skip the "sudo"-part when using it.
- Uses a minimum cap of 5% lightness as standard, which can be easily changed using the /etc/lightscript/minlight file. (Some controllers will turn the screen pitchblack on 0%)
- Is very forgiving on "bad systems", while still doing a lot of safety-checks.
It is available on AUR where it goes by the nameAUR, the only dependencies it needs is bash and bc (which you should already have installed really). An optional dependency is sudo, which it will automatically try to use if it can find it (so you wont have to type "sudo light x" everytime). All dependencies are available in the official repos.
LightScript takes 1 argument and 1 argument only: The brightness you would like, given in percent (without the %). Example:
to use 30% brightness. Remember the script needs root, although if you have sudo installed it will attempt to use this automatically(you do not need to invoke it).
The script has a minimum cap of 5% brightness since some controllers will turn the screen pitchblack on 0%, override this in /etc/lightscript/minlight.
Please give bugs/feedback either directly on the AUR-page comments, or via mail to fredrik dot haikarainen at gmail dot com.