Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Last active December 25, 2015 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ajnasz/6948889 to your computer and use it in GitHub Desktop.
Save Ajnasz/6948889 to your computer and use it in GitHub Desktop.
Locks the screen after wakeup
#!/bin/sh
# Lock screen after wakeup
[ -f /proc/acpi/ibm/led ] || exit $NA
# User who locked the screen
USERNAME="ajnasz"
# Command to lock the screen
COMMAND="/usr/local/bin/alock -auth pam -bg blank"
case "$1" in
hibernate|suspend)
;;
thaw|resume)
sudo -u $USERNAME $COMMAND
;;
*) exit $NA
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment