diff options
| author | jason | 2023-05-30 15:58:11 -0600 |
|---|---|---|
| committer | jason | 2023-05-30 15:58:30 -0600 |
| commit | 3461603cdee1d41c5fff022de728c6f22cdf0ba6 (patch) | |
| tree | fdedaf4a98f6f9c941c937db88684842695a70a0 /scripts/bin | |
| parent | 1d0ae526f6302b259da1fcac9a720215f0f89ed2 (diff) | |
| download | dotfiles-3461603cdee1d41c5fff022de728c6f22cdf0ba6.tar.gz dotfiles-3461603cdee1d41c5fff022de728c6f22cdf0ba6.zip | |
add little lock script
Diffstat (limited to 'scripts/bin')
| -rwxr-xr-x | scripts/bin/lock | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/bin/lock b/scripts/bin/lock new file mode 100755 index 0000000..f73b3de --- /dev/null +++ b/scripts/bin/lock | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #!/bin/sh -e | ||
| 2 | |||
| 3 | # Take a screenshot | ||
| 4 | scrot -o /tmp/screen_locked.png | ||
| 5 | # Pixellate it 10x | ||
| 6 | mogrify -scale 10% -scale 1000% /tmp/screen_locked.png | ||
| 7 | # Lock screen displaying this image. | ||
| 8 | i3lock -i /tmp/screen_locked.png | ||
| 9 | # Turn the screen off after a delay. | ||
| 10 | sleep 60 | ||
| 11 | # if i3lock is still running | ||
| 12 | pgrep i3lock && xset dpms force off | ||