]> git.sev.monster Git - dotfiles.git/blame - bin/lck
link dabuild and dabuild-admin from docker-abuild
[dotfiles.git] / bin / lck
CommitLineData
de6b1600 1#!/bin/sh
2
3# term lock
4if [ -z "$DISPLAY" ]; then
ba63cd01 5 if [ "$OSTYPE" = "freebsd" ]; then
6 lock -npv
7 else
8 lock -np
9 fi
de6b1600 10 exit
11fi
12
13# xorg lock
14img=~/tmp/lock.png
15if [ -f "$img" ]; then
16 # rudimentary attempt to prevent multiple locks
ba63cd01 17 # XXX: could block lock and replace with malicious locker to grab password
de6b1600 18 echo "Lock file exists at '$img', exiting"
19 exit 1
20fi
21res="$(xdpyinfo | grep dimensions | awk '{print $2}')"
22scale=0.07
23ffmpeg -y -loglevel 0 \
ba63cd01 24 -s "$res" -f x11grab -i $DISPLAY -i ~/share/lck/overlay.png \
de6b1600 25 -filter_complex "
26 [0]
27 scale=iw * $scale:ih * $scale,
28 noise=alls=2,
29 scale=`echo $res | tr x :`:flags=neighbor,
30 noise=alls=5,
31 gblur=8
32 [composite];
33 [composite]
34 [1] overlay=x=(main_w - overlay_w) / 2 + 0.5:
35 y=(main_h - overlay_h) / 2
36 [out]" \
37 -map "[out]" -vframes 1 "$img"
38# pause dunst
f7960c69 39pkill -USR1 dunst
de6b1600 40i3lock -nefi "$img"
41rm "$img"
f7960c69 42pkill -USR2 dunst
This page took 0.036003 seconds and 4 git commands to generate.