]>
Commit | Line | Data |
---|---|---|
a58ad2f0 | 1 | #!/bin/sh |
2 | ||
3 | # term lock | |
4 | if [ -z "$DISPLAY" ]; then | |
5 | lock -npv | |
6 | exit | |
7 | fi | |
8 | ||
9 | # xorg lock | |
10 | img=~/tmp/lock.png | |
11 | if [ -f "$img" ]; then | |
12 | # rudimentary attempt to prevent multiple locks | |
13 | # XXX: could block lock and replace with malicious locker | |
14 | echo "Lock file exists at '$img', exiting" | |
15 | exit 1 | |
16 | fi | |
17 | res="$(xdpyinfo | grep dimensions | awk '{print $2}')" | |
18 | scale=0.07 | |
19 | ffmpeg -y -loglevel 0 \ | |
20 | -s "$res" -f x11grab -i $DISPLAY -i ~/share/l/overlay.png \ | |
21 | -filter_complex " | |
22 | [0] | |
23 | scale=iw * $scale:ih * $scale, | |
24 | noise=alls=2, | |
25 | scale=`echo $res | tr x :`:flags=neighbor, | |
26 | noise=alls=5, | |
27 | gblur=8 | |
28 | [composite]; | |
29 | [composite] | |
30 | [1] overlay=x=(main_w - overlay_w) / 2 + 0.5: | |
31 | y=(main_h - overlay_h) / 2 | |
32 | [out]" \ | |
33 | -map "[out]" -vframes 1 "$img" | |
34 | # pause dunst | |
35 | killall -USR1 dunst | |
36 | i3lock -nefi "$img" | |
37 | rm "$img" | |
38 | killall -USR2 dunst |