# backlightctl A simple script to change the backlight brightness value on laptops. Mostly made as a workaround for [this bug](https://bugzilla.kernel.org/show_bug.cgi?id=203905). ## Configuration The only configurable variable is the backlight path. It defaults to `/sys/class/backlight/amdgpu_bl0`. You can change `BACKLIGHT_PATH` (in the script itself, for security reasons bla bla bla) to point to the file path. ## Usage ``` Usage: backlightctl [-hq] [-s VALUE] [-c VALUE] No arguments: Print current brightness and exit If -s and -c are specified, -c takes priority -h show this help -q print current brightness to stdout and exit -s set brightness to VALUE -c change brightness by VALUE ``` ## Recommendations - `chown root:root` the file - Move this script to `/usr/local/bin` - If your backlight isn't saved on reboot, add the following to `/etc/rc.local`: ``` /usr/local/bin/backlightctl -s ``` - (doas) add the following to `/etc/doas.conf`: ``` permit nopass :wheel as root cmd backlightctl ``` - (sudo) add the following to `/etc/sudoers` (using `visudo`): ``` %wheel ALL=(ALL:ALL) NOPASSWD: /usr/local/bin/backlightctl ```