summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xi3-lock-wrapper32
1 files changed, 32 insertions, 0 deletions
diff --git a/i3-lock-wrapper b/i3-lock-wrapper
new file mode 100755
index 0000000..556ab5a
--- /dev/null
+++ b/i3-lock-wrapper
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+#
+# Performs a standard screen lock, with an extra bit of style. Before locking
+# the screen, takes a screenshot of the current display and programatically
+# blurs and desaturates the image, using that for the lock screen background. A
+# mighty neat effect.
+#
+# Requirements: i3-lock imagemagick [scrot] [xbacklight]
+#
+
+base=/tmp/i3-lock-wrapper-$(date "+%s")
+file1=base.jpg
+file2=base2.png
+
+if [[ $(which import) ]]; then
+ import -window root "$file1"
+elif [[ $(which scrot) ]]; then
+ scrot -d0 "$file1"
+else
+ echo "Screenshot command not found (scrot or import). Exiting."
+fi
+
+convert "$file1" -blur 0x4 -modulate 110,50 "$file2"
+
+
+xbacklight -set 2% -time 3000 -steps 100&
+
+i3lock -i "$file2" -n
+
+xbacklight -set 10% -time 2000 -steps 100
+
+rm "$file1" "$file2"

Generated by cgit