Created
January 12, 2016 16:28
-
-
Save brvier/8aa17ab80338ae8d70e7 to your computer and use it in GitHub Desktop.
i3 filesaver script used with xautolock and bluetooth proximity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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