Skip to content

Instantly share code, notes, and snippets.

@tremby
Created January 6, 2012 18:05
Show Gist options
  • Save tremby/1571684 to your computer and use it in GitHub Desktop.
Save tremby/1571684 to your computer and use it in GitHub Desktop.
lock -- update status and lock screen
#!/bin/bash
if [ "$(purple-remote getstatus)" = "available" ]; then
setstatus=true
else
setstatus=false
fi
if $setstatus; then
echo "setting away"
im away
fi
if [ $DISPLAY ]; then
i3lock -n &
sleep 0.5s #wait a bit so I can see that it definitely locked
screens off
else
vlock -a </dev/stdin
fi
wait
if $setstatus; then
echo "restoring"
im back
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment