dotfiles/bin/led.sh
2022-03-18 15:00:33 +01:00

14 lines
342 B
Bash
Executable File

#!/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