Skip to content

Instantly share code, notes, and snippets.

@jcubic
Last active December 27, 2016 10:53
Show Gist options
  • Save jcubic/d38862247fcc2aa57bddf826df1db13e to your computer and use it in GitHub Desktop.
Save jcubic/d38862247fcc2aa57bddf826df1db13e to your computer and use it in GitHub Desktop.
Toggle Display and keyboard highlight on asus laptop on GNU/Linux
#!/bin/bash
file=/tmp/display
KBBL="/sys/class/leds/asus::kbd_backlight"
if [ -e $file ]; then
rm $file
sudo vbetool dpms on
[ -d $KBBL -o -f $KBBL ] && echo 3 | sudo tee $KBBL/brightness > /dev/null
else
touch $file
sudo vbetool dpms off
[ -d $KBBL -o -f $KBBL ] && echo 0 | sudo tee $KBBL/brightness > /dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment