Skip to content

Instantly share code, notes, and snippets.

@brvier
Created January 12, 2016 16:28
Show Gist options
  • Save brvier/8aa17ab80338ae8d70e7 to your computer and use it in GitHub Desktop.
Save brvier/8aa17ab80338ae8d70e7 to your computer and use it in GitHub Desktop.
i3 filesaver script used with xautolock and bluetooth proximity
#!/bin/sh -e
DEVICE=E4:F8:EF:1F:D1:F4
DEV_NAME="K"
opt=`hcitool name $DEVICE`
if [ "$opt" = "$DEV_NAME" ]; then
echo "Device '$opt' found"
else
echo "Can't find device $DEVICE ($DEV_NAME); locking!"
# Take a screenshot
scrot -z /tmp/screen_locked.png
# Pixellate it 10x
mogrify -scale 10% -scale 1000% /tmp/screen_locked.png
# Lock screen displaying this image.
i3lock -i /tmp/screen_locked.png
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment