summaryrefslogtreecommitdiff
path: root/scripts/.local/bin/ilock
diff options
context:
space:
mode:
authorivan-boikov <ik.boikov.public@protonmail.com>2022-05-22 22:30:45 +0200
committerivan-boikov <ik.boikov.public@protonmail.com>2022-05-22 22:30:45 +0200
commitf7498cf11733a375e2a70e5139659d10036faf0c (patch)
tree7436d8ba9f044b89dcc5c04e7fa82ff175473332 /scripts/.local/bin/ilock
parent688f02cc56104ef13dc923ee86c9801cecf0f759 (diff)
new wallpapers, simplified locking script
Diffstat (limited to 'scripts/.local/bin/ilock')
-rwxr-xr-xscripts/.local/bin/ilock40
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/.local/bin/ilock b/scripts/.local/bin/ilock
new file mode 100755
index 0000000..6450407
--- /dev/null
+++ b/scripts/.local/bin/ilock
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+icon="$HOME/.local/share/icons/lock.png"
+pngfile='/tmp/screen.png'
+bmpfile='/tmp/screen.bmp'
+glitchedfile="/tmp/sclock_g.bmp"
+
+(( $# )) && { icon=$1; }
+
+# flush keyring passwords
+gnome-keyring-daemon -r -d
+
+# generate fancy lock screen
+rm "$pngfile"
+maim > "$pngfile"
+
+# old method
+#convert "$pngfile" -scale 5% -scale 2000% "$pngfile"
+
+# new method with heavy distortion
+convert -rotate -90 $pngfile $bmpfile
+for a in {1,2,4,5,2}
+do
+ # Glitch it with sox FROM: https://maryknize.com/blog/glitch_art_with_sox_imagemagick_and_vim/
+ sox -t ul -c 1 -r 48k $bmpfile -t ul $glitchedfile trim 0 90s : echo 0.2 0.3 $((a*3)) 0.7
+ # Rotate it by 90 degrees
+ convert -scale $((100/(a)))% -scale $((100*(a)))% -rotate 90 $glitchedfile $bmpfile
+done
+convert -gamma 0.1 -gravity center -font "Liberation-Mono" \
+ -pointsize 200 -channel RGBA -fill '#bf616a' \
+ $bmpfile $pngfile
+
+convert "$pngfile" "$icon" -gravity center -composite -matte "$pngfile"
+
+
+playerctl pause
+
+#sxiv $pngfile
+
+i3lock -u -i "$pngfile"