dotfiles/bin/led.sh

14 lines
342 B
Bash
Raw Normal View History

2022-03-18 14:34:27 +01:00
#!/bin/zsh
if [[ "${1}" == "on" ]]; then
echo 1 > /sys/class/leds/input*::scrolllock/brightness
elif [[ "${1}" == "off" ]]; then
echo 0 > /sys/class/leds/input*::scrolllock/brightness
elif [[ "${1}" == "toggle" ]]; then
if [[ $(cat /sys/class/leds/input*::scrolllock/brightness) -eq 0 ]]; then
"${0}" on
else
"${0}" off
fi
fi