+#!/bin/sh
+
+# term lock
+if [ -z "$DISPLAY" ]; then
+ lock -npv
+ exit
+fi
+
+# xorg lock
+img=~/tmp/lock.png
+if [ -f "$img" ]; then
+ # rudimentary attempt to prevent multiple locks
+ # XXX: could block lock and replace with malicious locker
+ echo "Lock file exists at '$img', exiting"
+ exit 1
+fi
+res="$(xdpyinfo | grep dimensions | awk '{print $2}')"
+scale=0.07
+ffmpeg -y -loglevel 0 \
+ -s "$res" -f x11grab -i $DISPLAY -i ~/share/l/overlay.png \
+ -filter_complex "
+ [0]
+ scale=iw * $scale:ih * $scale,
+ noise=alls=2,
+ scale=`echo $res | tr x :`:flags=neighbor,
+ noise=alls=5,
+ gblur=8
+ [composite];
+ [composite]
+ [1] overlay=x=(main_w - overlay_w) / 2 + 0.5:
+ y=(main_h - overlay_h) / 2
+ [out]" \
+ -map "[out]" -vframes 1 "$img"
+# pause dunst
+killall -USR1 dunst
+i3lock -nefi "$img"
+rm "$img"
+killall -USR2 dunst