Skip to content

Instantly share code, notes, and snippets.

@kevinchappell
Created August 9, 2021 19:28
Show Gist options
  • Save kevinchappell/a0e3ec7fb5a073b58b8433a7164cdc7a to your computer and use it in GitHub Desktop.
Save kevinchappell/a0e3ec7fb5a073b58b8433a7164cdc7a to your computer and use it in GitHub Desktop.
listen for system lock and disable asus screenpad
#!/bin/bash
gdbus monitor -y -d org.freedesktop.login1 |\
grep --line-buffered -i "LockedHint" |\
sed -uE 's/.*LockedHint.*<(.*)>.*/\1/g' |\
while read IS_LOCKED; do
LOCK_STAT=`echo $MSG | awk '{print $NF}'`
if [[ "$IS_LOCKED" == "true" ]]; then
echo 0 | tee '/sys/class/leds/asus::screenpad/brightness'
else
echo 250 | tee '/sys/class/leds/asus::screenpad/brightness'
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment