summaryrefslogtreecommitdiff
path: root/scripts/lock
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2015-10-23 03:14:36 -0300
committerMatias Linares <matiaslina@openmailbox.org>2015-10-23 03:14:36 -0300
commit5b132bf1244a008ad3ce67688030a7678831f77d (patch)
tree501aa27e89f81d5f4bdfaab31c72378991a9c749 /scripts/lock
downloaddotfiles-5b132bf1244a008ad3ce67688030a7678831f77d.tar.gz
Initial commit
Diffstat (limited to 'scripts/lock')
-rwxr-xr-xscripts/lock18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/lock b/scripts/lock
new file mode 100755
index 0000000..4046b49
--- /dev/null
+++ b/scripts/lock
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+bg=/tmp/screen.png
+lock_png=${HOME}/scripts/lock.png
+_backlight=$(xbacklight -get)
+backlight=${_backlight::2}
+
+scrot ${bg}
+#convert ${bg} -scale 25% -scale 400% ${bg}
+convert ${bg} -blur 0x2 -sharpen 1x4 ${bg}
+
+[[ -f ${lock_png} ]] && convert ${bg} ${lock_png} \
+ -gravity center -composite -matte \
+ ${bg}
+xbacklight -set 10
+i3lock -u -n -i ${bg}
+rm ${bg}
+xbacklight -set $backlight