dotfiles/kb-brightness

16 lines
300 B
Bash
Executable File

#!/bin/bash
kbdb='/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness'
step=25
current=`cat $kbdb`
new=$current
if [ "$1" == "up" ];then
new=$(($current + $step))
elif [ "$1" == "down" ];then
new=$(($current - $step))
fi
if [ $new -le 0 ];then
new=0
fi
echo $new > $kbdb