dotfiles/scripts/keyboard_backlight.sh

26 lines
372 B
Bash
Raw Permalink Normal View History

2023-12-25 11:21:57 +01:00
#!/bin/bash
brightness=`cat /sys/class/leds/asus::kbd_backlight/brightness`
max=3
min=0
if [ "$1" == "inc" ]; then
brightness=`expr $brightness + 1`
else
brightness=`expr $brightness - 1`
fi
if [ $brightness -gt 3 ]; then
brightness=3
fi
if [ $brightness -lt 0 ]; then
brightness=0
fi
echo $brightness > /sys/class/leds/asus::kbd_backlight/brightness