Difference between revisions of "Light"
Haikarainen (talk | contribs) |
m (rm self-redirect) |
||
Line 1: | Line 1: | ||
[[Category:Power management]] | [[Category:Power management]] | ||
− | Light is a program used to easily control a screens backlight-controllers. It is the successor of | + | Light is a program used to easily control a screens backlight-controllers. It is the successor of ''LightScript'', and is also its official C-port. |
== Features == | == Features == |
Revision as of 17:21, 12 September 2014
Light is a program used to easily control a screens backlight-controllers. It is the successor of LightScript, and is also its official C-port.
Contents
Features
- Works excellent where other software has been proven to be unusable or problematic, thanks to how it operates internally and to the fact that it does not rely on X.
- Can automatically figure out the best controller to use, making full use of underlying hardware. (Does not use vendor-specific ACPI or even ACPI at all, but uses driver implementations. This is against recommendations but this is what has been proven to work best when all else fails).
- Possibility to set a minimum brightness value, as some controllers set the screen to be pitch black at a value of 0 (or higher).
Installation
AUR
Light has 2 different packages on the AUR, lightAUR for the latest tagged version, or light-gitAUR for the absolutely latest version with the most features. Patches are frequently committed to the git repository so it is recommended to use the light-gitAUR package to make sure you have the latest features/bug-fixes.
Manual
It is also available for manual install, the git repository is available here at https://github.com/haikarainen/light. It's a breeze to install manually, an example follows:
mkdir -p ~/ports/light cd ~/ports/light git clone https://github.com/haikarainen/light . make sudo make install
Just make sure to have gcc, make, git (and sudo for the example above) installed. These are basic development utilities and are usually available from your distributions official repositories.
Usage
This application usually has 4 different criteria on flags to use, which are operation modes, value mode, target and controller mode. Flags from these different modes can never be used in conjunction, but all of them do not always have to be specified (although it is recommended to do so for verbosity).
- -v 0: No debug output
- -v 1: Errors
- -v 2: Errors, warnings
- -v 3: Errors, warnings, notices
Operation modes
The operation modes describe what you want to do.
- -G: Which reads/gets brightness/data from controllers/files
- -S: Which writes/sets brightness/data to controllers/files
- -A: Which does like -S but instead adds the value
- -U: Which does like -S but instead subtracts the value
- -O: Save the current brightness for later use (usually used on shutdown)
- -I: Restore the previously saved brightness (usually used on boot)
- -L: List the available controllers
When used by themselves operate on the brightness of a controller that is selected automatically. S, A and U needs another argument -- except for the main 4 criteria -- which is the value to set/add/subtract. This can be specified either in percent or in raw values, but remember to specify the value mode (read below) if you want to write raw values.
Value modes
The value mode specify in what unit you want to read or write values in. The default one (if not specified) is in percent, the other one is raw mode and should always be used when you need very precise values (or only have a controller with a very small amount of brightness levels).
- -p: Percent
- -r: Raw mode
Remember, this is the unit that will be used when you set, get, add or subtract brightness values.
Target
As you can not only handle the brightness of controllers, you may also specify a target to read/write from/to:
- -b: Current brightness of selected controller
- -m: Maximum brightness of selected controller
- -c: Minimum brightness (cap) of selected controller
The minimum brightness is a feature implemented as some controllers make the screen go pitch black at 0%, if you have a controller like that, it is recommended to set this value (in either percent or in raw mode). These values will be saved in raw mode though, so if you specify it in percent it might not be too accurate depending on your controller.
Controller modes
Finally, you can either use the built-in controller selection to get the controller with the maximum precision, or you can specify one manually with the -s flag. The -a flag will force automatic mode and is default. Use -L to get a list of controllers to use with the -s flag (to specify which controller to use).
Examples
Get the current brightness in percent
light -G
Increase brightness by 5 percent
light -A 5
Set the minimum cap to 2 in raw value on the acpi_video0 controller:
light -Scrs "acpi_video0" 2
Bugs/Feedback
Please give bugs/feedback directly on the AUR-page comments.