Brightness control in bash.
This utility handles display brightness when backlight control is exposed to the user through a sysfs interface at /sys/class/backlight
. By default, the brightness level is managed for every registered class device through its backlight sysfs entry.
bash
- ACPI, graphic or platform driver controlling brightness and exposing a sysfs interface.
[ "$(ls -A /sys/class/backlight)" ] && echo "Yea" || echo "Nay"
- Installed by a sudoer
-
Clone the repository.
git clone https://github.com/rafa-garcia/bashlight
-
Change working directory to
bashlight
.cd bashlight
-
Run
sudo make install
from the root directory to install the script, manpage and udev rule.- The
90-backlight.rules
udev rule will be added to allow thevideo
group to control backlight - The
video
group must have the user that runs the application as member
- The
bashlight
can also be uninstalled easily with sudo make uninstall
.
usage: bashlight [options]
Where options are:
-help Print out a summary of the usage and exit
-version Print out the program version and exit
-get Print out the current backlight brightness of each output
-set <percentage> Sets each backlight brightness to the specified level
-inc <percentage> Increases brightness by the specified amount
-dec <percentage> Decreases brightness by the specified amount
-time <milliseconds> Length of time to transition to new value. Default is 200
-steps <steps> Number of steps to take while transitioning. Default is 20
After moving to Wayland, I struggled to find a portable (as in pure bash) X.Org's xbacklight
-like utility that does not require X and handles similar CLI options.
The application is licensed under the MIT License.