Last updated: 11 Aug 23 05:41:12 (UTC)

Making the Zenbook keyboard light go sleeby

Making the Zenbook keyboard light go sleeby

According to the manpage of systemd-suspend.service, the /lib/systemd/system-sleep folder has scripts that are fired off proximate to suspend. I put “kbd_light” in there.

#!/bin/sh

# diddling the keyboard light


LIGHT=/sys/class/leds/asus::kbd_backlight/brightness

case $1 in

pre)
    cat $LIGHT > /root/.kbd_bright
    echo 0 > $LIGHT
    ;;

post) cat /root/.kbd_bright > $LIGHT ;;
esac
#!/bin/sh

# diddling the keyboard light


LIGHT=/sys/class/leds/asus::kbd_backlight/brightness

case $1 in

pre)
    cat $LIGHT > /root/.kbd_bright
    echo 0 > $LIGHT
    ;;

post) cat /root/.kbd_bright > $LIGHT ;;
esac