UbuntuConfig/i3/brightness.sh

11 lines
302 B
Bash
Raw Normal View History

2023-10-14 17:39:34 +08:00
#!/bin/sh
# Change below to suit your system
BACKLIGHT="/sys/class/backlight/amdgpu_bl0"
BRIGHTNESS="$BACKLIGHT/brightness"
MAX_BRIGHTNESS=$(cat "$BACKLIGHT/max_brightness")
inotifywait -m -e modify "$BRIGHTNESS" \
| while IFS= read -r line; do cat $BRIGHTNESS; done \
| xob -m "$MAX_BRIGHTNESS"