|
@@ -1,11 +1,11 @@
|
1
|
|
-Light - A Program to Control Backlight Controllers
|
|
1
|
+Light - A program to control backlights (and other hardware lights) in GNU/Linux
|
2
|
2
|
==================================================
|
3
|
3
|
|
4
|
4
|
- [Introduction](#introduction)
|
5
|
5
|
- [Examples](#examples)
|
6
|
6
|
- [Usage](#usage)
|
7
|
|
- - [Commands](#commands)
|
8
|
|
- - [Options](#options)
|
|
7
|
+ - [Command options](#command-options)
|
|
8
|
+ - [Extra options](#extra-options)
|
9
|
9
|
- [Installation](#installation)
|
10
|
10
|
- [Arch Linux](#arch-linux)
|
11
|
11
|
- [Fedora](#fedora)
|
|
@@ -17,25 +17,22 @@ Light - A Program to Control Backlight Controllers
|
17
|
17
|
Introduction
|
18
|
18
|
------------
|
19
|
19
|
|
20
|
|
-[Light][] is a program to control backlight controllers under GNU/Linux:
|
|
20
|
+[Light][] is a program to control backlights and other lights under GNU/Linux:
|
21
|
21
|
|
22
|
|
-* Works, in particular when other software, e.g. xbacklight, does not
|
23
|
|
-* Does not rely on X
|
24
|
|
-* Automatically detects the best controller
|
25
|
|
-* Possibility to set a minimum brightness value
|
|
22
|
+* Works where other software has proven unreliable (xbacklight etc.)
|
|
23
|
+* Works even in a fully CLI-environment, i.e. it does not rely on X
|
|
24
|
+* Provides functionality to automatically control backlights with the highest precision available
|
|
25
|
+* Extra features, like setting a minimum brightness value for controllers, or saving/restoring the value for poweroffs/boots.
|
26
|
26
|
|
27
|
|
-Let's get started with a few examples! See the following sections for
|
28
|
|
-the detailed descriptions of all available commands, options and how to
|
29
|
|
-access different controllers.
|
|
27
|
+See the following sections for the detailed descriptions of all available commands, options and how to access different controllers.
|
30
|
28
|
|
31
|
|
-Light is available in many GNU/Linux distributions already, and it also
|
32
|
|
-has a fork called [brillo][] by [Cameron Nemo](@CameronNemo).
|
|
29
|
+Light is available in many GNU/Linux distributions already.
|
33
|
30
|
|
34
|
31
|
|
35
|
32
|
Examples
|
36
|
33
|
--------
|
37
|
34
|
|
38
|
|
-Get the current brightness in percent
|
|
35
|
+Get the current backlight brightness in percent
|
39
|
36
|
|
40
|
37
|
light -G
|
41
|
38
|
|
|
@@ -43,99 +40,58 @@ or
|
43
|
40
|
|
44
|
41
|
light
|
45
|
42
|
|
46
|
|
-Increase brightness by 5 percent
|
|
43
|
+Increase backlight brightness by 5 percent
|
47
|
44
|
|
48
|
45
|
light -A 5
|
49
|
46
|
|
50
|
|
-Set the minimum cap to 2 in raw value on the acpi_video0 controller:
|
|
47
|
+Set the minimum cap to 2 in raw value on the sysfs/backlight/acpi_video0 device:
|
51
|
48
|
|
52
|
|
- light -cr -s acpi_video0 -S 2
|
|
49
|
+ light -Nrs "sysfs/backlight/acpi_video0" 2
|
53
|
50
|
|
54
|
|
-Try to set the brightness to 0 after that, it will be changed to the
|
55
|
|
-minimum 2:
|
|
51
|
+List available devices
|
56
|
52
|
|
57
|
|
- light -r -s acpi_video0 -S 0
|
|
53
|
+ light -L
|
58
|
54
|
|
59
|
|
-Find keyboard controllers:
|
60
|
|
-
|
61
|
|
- light -k -L
|
62
|
|
-
|
63
|
|
-Activate `ScrollLock` LED, here `input15` is used, but this varies
|
|
55
|
+Activate the Num. Lock keyboard LED, here `sysfs/leds/input3::numlock` is used, but this varies
|
64
|
56
|
between different systems:
|
65
|
57
|
|
66
|
|
- light -k -s "input15::scrolllock" -S 100
|
67
|
|
-
|
68
|
|
-Usually, LEDs only take 0 or 1 in raw value (i.e. for off/on), so you
|
69
|
|
-can instead write:
|
70
|
|
-
|
71
|
|
- light -kr -s "input15::scrolllock" -S 1
|
72
|
|
-
|
73
|
|
-Verify by reading back the max brightness, you should get a value of 1:
|
74
|
|
-
|
75
|
|
- light -kr -m -s "input15::scrolllock
|
|
58
|
+ light -Srs "sysfs/leds/input3::numlock" 1
|
76
|
59
|
|
77
|
60
|
|
78
|
61
|
Usage
|
79
|
62
|
-----
|
80
|
63
|
|
81
|
|
-### Commands
|
82
|
|
-
|
83
|
|
-* `-G`: Get (read) brightness/data from controllers/files
|
84
|
|
-* `-S VAL`: Set (write)brightness/data to controllers/files
|
85
|
|
-* `-A VAL`: Like `-S`, but adds the given value
|
86
|
|
-* `-U VAL`: Like `-S`, but subtracts the given value
|
87
|
|
-* `-O`: Save the current brightness for later use (usually used on shutdown)
|
88
|
|
-* `-I`: Restore the previously saved brightness (usually used on boot)
|
89
|
|
-* `-L`: List available controllers, see below `-k` option as well
|
|
64
|
+Usage follows the following pattern, where options are optional and the neccesity of value depends on the options used
|
|
65
|
+
|
|
66
|
+ light [options] <value>
|
90
|
67
|
|
91
|
|
-Without any options (below) the commands operate on the brightness of an
|
92
|
|
-automatically selected controller. Values are given in percent, unless
|
93
|
|
-the below `r` option is also given.
|
|
68
|
+### Command options
|
94
|
69
|
|
95
|
|
-**Note:** like most UNIX applications, light only gives output on
|
96
|
|
- errors. If something goes wrong try the verbosity option `-v VAL`:
|
|
70
|
+You may only specify one command flag at a time. These flags decide what the program will ultimately end up doing.
|
97
|
71
|
|
98
|
|
-* 0: No debug output
|
99
|
|
-* 1: Errors
|
100
|
|
-* 2: Errors, warnings
|
101
|
|
-* 3: Errors, warnings, notices
|
|
72
|
+* `-H` Show help and exit
|
|
73
|
+* `-V` Show program version and exit
|
|
74
|
+* `-L` List available devices
|
|
75
|
+* `-A` Increase brightness by value (value needed!)
|
|
76
|
+* `-U` Decrease brightness by value (value needed!)
|
|
77
|
+* `-S` Set brightness to value (value needed!)
|
|
78
|
+* `-G` Get brightness
|
|
79
|
+* `-N` Set minimum brightness to value (value needed!)
|
|
80
|
+* `-P` Get minimum brightness
|
|
81
|
+* `-I` Save the current brightness
|
|
82
|
+* `-O` Restore the previously saved brightness
|
102
|
83
|
|
103
|
|
-### Options
|
|
84
|
+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.
|
104
|
85
|
|
105
|
|
-Values may be given, or presented, in percent or raw mode. Raw mode is
|
106
|
|
-the format specific to the controller. The default is in percent, but
|
107
|
|
-raw mode may be required for precise control, or when the steps are very
|
108
|
|
-few, e.g. for most keyboard backlight controllers.
|
|
86
|
+**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.
|
109
|
87
|
|
110
|
|
-* `-p`: Percent, default
|
111
|
|
-* `-r`: Raw mode
|
|
88
|
+### Extra options
|
112
|
89
|
|
113
|
|
-By default the screen is the active target for all commands, use `-k` to
|
114
|
|
-select the keyboard instead. In either case you may need to select a
|
115
|
|
-different controller, see below.
|
|
90
|
+These can be mixed, combined and matched after convenience.
|
116
|
91
|
|
117
|
|
-* `-l`: Act on screen backlight, default
|
118
|
|
-* `-k`: Act on keyboard backlight and LEDs
|
119
|
|
-
|
120
|
|
-By default commands act on the brightness property, which is read+write.
|
121
|
|
-The maximum brightness is a read-only property. The minimum brightness
|
122
|
|
-cap is a feature implemented to protect against setting brightness too
|
123
|
|
-low, since some controllers make the screen go pitch black at 0%. For
|
124
|
|
-controllers like that it is recommended to set this value.
|
125
|
|
-
|
126
|
|
-* `-b`: Current brightness of selected controller, default
|
127
|
|
-* `-m`: Max. brightness of selected controller
|
128
|
|
-* `-c`: Min. brightness (cap) of selected controller (recommend raw mode)
|
129
|
|
-
|
130
|
|
-Controller is automatically done to select the controller with maximum
|
131
|
|
-precision. It can however also be done manually and we recommend the
|
132
|
|
-`-L` and `-Lk` commands to list available controllers:
|
133
|
|
-
|
134
|
|
-* `-a`: Automatic controller selection
|
135
|
|
-* `-s ARG`: Manual controller selection
|
136
|
|
-
|
137
|
|
-**Note:** Without the `-s` flag on _every_ command light will default
|
138
|
|
- to automatic controller selection.
|
|
92
|
+* `-r` Raw mode, values (printed and interpreted from commandline) will be treated as integers in the controllers native range, instead of in percent.
|
|
93
|
+* `-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.
|
|
94
|
+* `-s <devicepath>` Specifies which device to work on. List available devices with the -L command. Full path is needed.
|
139
|
95
|
|
140
|
96
|
|
141
|
97
|
Installation
|
|
@@ -145,11 +101,8 @@ Installation
|
145
|
101
|
|
146
|
102
|
If you run Arch Linux, there exists 2 packages;
|
147
|
103
|
|
148
|
|
-* [light-git][] - For the absolutely latest version
|
149
|
|
-* [light-tag][] - For the latest tagged release
|
150
|
|
-
|
151
|
|
-We recommend you go with light-git as you might miss important features
|
152
|
|
-and bugfixes if you do not.
|
|
104
|
+* [light-git][] - For the latest development branch (master)
|
|
105
|
+* [light][] - For the latest stable release
|
153
|
106
|
|
154
|
107
|
|
155
|
108
|
### Fedora
|
|
@@ -163,17 +116,15 @@ and you're good to go.
|
163
|
116
|
|
164
|
117
|
### Manual
|
165
|
118
|
|
166
|
|
-We recommended downloading a versioned tarball from the relases page on
|
167
|
|
-GitHub. Download and untar the archive:
|
|
119
|
+If you download a stable release, these are the commands that will get you up and running:
|
168
|
120
|
|
169
|
121
|
tar xf light-x.yy.tar.gz
|
170
|
122
|
cd light-x.yy/
|
171
|
123
|
./configure && make
|
172
|
124
|
sudo make install
|
173
|
125
|
|
174
|
|
-However, should you want to try the latest GitHub source you first need
|
175
|
|
-to clone the repository and run the `autogen.sh` script. This requires
|
176
|
|
-`automake` and `autoconf` to be installed on your system.
|
|
126
|
+However the latest development branch requires some extras. Clone the repository and run the `autogen.sh` script. This requires that
|
|
127
|
+`automake` and `autoconf` is installed on your system.
|
177
|
128
|
|
178
|
129
|
./autogen.sh
|
179
|
130
|
./configure && make
|
|
@@ -209,6 +160,5 @@ This is free software, see the source for copying conditions. There is NO
|
209
|
160
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
|
210
|
161
|
|
211
|
162
|
[Light]: https://github.com/haikarainen/light/
|
212
|
|
-[brillo]: https://gitlab.com/cameronnemo/brillo/
|
213
|
163
|
[light-git]: https://aur.archlinux.org/packages/light-git
|
214
|
|
-[light-tag]: https://aur.archlinux.org/packages/light
|
|
164
|
+[light]: https://aur.archlinux.org/packages/light
|