#!/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"