backlightctl/readme.md

34 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2022-12-26 00:15:43 -06:00
# 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
2023-01-31 18:20:02 -06:00
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.
2022-12-26 00:15:43 -06:00
## Usage
```
2022-12-26 11:12:50 -06:00
Usage: backlightctl [-hq] [-s VALUE] [-c VALUE]
2022-12-26 00:15:43 -06:00
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 <VALUE> set brightness to VALUE
-c <VALUE> change brightness by VALUE
```
## Recommendations
2023-02-20 02:17:29 -06:00
- `chown root:root` the file
2022-12-26 00:15:43 -06:00
- 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 <your_preferred_brightness>
```
- (doas) add the following to `/etc/doas.conf`:
```
permit nopass :wheel as root cmd backlightctl
```
2022-12-26 10:31:53 -06:00
- (sudo) add the following to `/etc/sudoers` (using `visudo`):
```
%wheel ALL=(ALL:ALL) NOPASSWD: /usr/local/bin/backlightctl
```