Follow-up to f14f4ee0, use correct struct member
Signed-off-by: Joachim Nilsson <firstname.lastname@example.org>
|3 months ago|
|debian||6 months ago|
|src||3 months ago|
|.gitignore||11 months ago|
|90-backlight.rules||10 months ago|
|COPYING||11 months ago|
|ChangeLog.md||9 months ago|
|DOCUMENTATION.md||10 months ago|
|Makefile.am||9 months ago|
|README.md||3 months ago|
|autogen.sh||11 months ago|
|configure.ac||9 months ago|
|light.1||3 months ago|
Copyright (C) 2012 - 2018
Author: Fredrik Haikarainen
Contributor & Maintainer: Joachim Nilsson
This is free software, see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
Light is a program to control backlights and other lights under GNU/Linux:
See the following sections for the detailed descriptions of all available commands, options and how to access different controllers.
Light is available in many GNU/Linux distributions already.
Get the current backlight brightness in percent
Increase backlight brightness by 5 percent
light -A 5
Set the minimum cap to 2 in raw value on the sysfs/backlight/acpi_video0 device:
light -Nrs "sysfs/backlight/acpi_video0" 2
List available devices
Activate the Num. Lock keyboard LED, here
sysfs/leds/input3::numlock is used, but this varies
between different systems:
light -Srs "sysfs/leds/input3::numlock" 1
Usage follows the following pattern, where options are optional and the neccesity of value depends on the options used
light [options] <value>
You may only specify one command flag at a time. These flags decide what the program will ultimately end up doing.
-HShow help and exit
-VShow program version and exit
-LList available devices
-AIncrease brightness by value (value needed!)
-UDecrease brightness by value (value needed!)
-SSet brightness to value (value needed!)
-NSet minimum brightness to value (value needed!)
-PGet minimum brightness
-OSave the current brightness
-IRestore the previously saved brightness
Without any extra options, the command will operate on the device called
sysfs/backlight/auto, which works as it's own device however it proxies the backlight device that has the highest controller resolution (read: highest precision). Values are interpreted and printed as percentage between 0.0 - 100.0.
Note: If something goes wrong, you can find out by maxing out the verbosity flag by passing
-v 3 to the options. This will activate the logging of warnings, errors and notices. Light will never print these by default, as it is designed to primarily interface with other applications and not humanbeings directly.
These can be mixed, combined and matched after convenience.
-rRaw mode, values (printed and interpreted from commandline) will be treated as integers in the controllers native range, instead of in percent.
-v <verbosity>Specifies the verbosity level. 0 is default and prints nothing. 1 prints only errors, 2 prints only errors and warnings, and 3 prints both errors, warnings and notices.
-s <devicepath>Specifies which device to work on. List available devices with the -L command. Full path is needed.
The latest stable release is available in official repos, install with:
pacman -S light
Additionally, the latest development branch (master) is available on AUR: light-git
Fedora already has light packaged in main repos, so just run:
dnf install light
and you're good to go.
Pre-built .deb files, for the latest Ubuntu release, can be downloaded from the GitHub releases page. If you want to build your own there is native support available in the GIT sources. Clone and follow the development branch guidelines below followed by:
If you download a stable release, these are the commands that will get you up and running:
tar xf light-x.yy.tar.gz cd light-x.yy/ ./configure && make sudo make install
However the latest development branch requires some extras. Clone the repository and run the
autogen.sh script. This requires that
autoconf is installed on your system.
./autogen.sh ./configure && make sudo make install
configure script and
Makefile.in files are not part of GIT because they are generated at release time with
Optionally, instead of the classic SUID root mode of operation, udev rules can be set up to manage the kernel sysfs permissions. Use the configure script to enable this mode of operation:
./configure --with-udev && make sudo make install
This installs the
If your udev rules are located elsewhere, use
Note: make sure that your user is part of the
video group, otherwise you will not get access to the devices.
Note: in this mode
light runs unpriviliged, so the
directory (for cached settings) is not used, instead the per-user
~/.cache/light is used.