Skip to content

Instantly share code, notes, and snippets.

@ShivamMistry
Created May 8, 2014 16:12
Show Gist options
  • Save ShivamMistry/b55b5a9952b347865954 to your computer and use it in GitHub Desktop.
Save ShivamMistry/b55b5a9952b347865954 to your computer and use it in GitHub Desktop.
Suspension utility that locks before suspending using slimlock and pm-suspend (from pm-utils). Run with sudo
#!/usr/bin/env sh
if [ $(id -u) -eq "0" ]; then
su $(who -m | awk '{print $1;}') -c slimlock > /dev/null 2>&1 &
pm-suspend
else
echo "Run with sudo instead"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment