]> git.sev.monster Git - dotfiles.git/blame - bin/lck
fix which usage, create function check-busybox
[dotfiles.git] / bin / lck
CommitLineData
a58ad2f0 1#!/bin/sh
2
3# term lock
4if [ -z "$DISPLAY" ]; then
d877aef2 5 if [ "$OSTYPE" = "freebsd" ]; then
6 lock -npv
7 else
8 lock -np
9 fi
a58ad2f0 10 exit
11fi
12
13# xorg lock
14img=~/tmp/lock.png
15if [ -f "$img" ]; then
16 # rudimentary attempt to prevent multiple locks
d877aef2 17 # XXX: could block lock and replace with malicious locker to grab password
a58ad2f0 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 \
d877aef2 24 -s "$res" -f x11grab -i $DISPLAY -i ~/share/lck/overlay.png \
a58ad2f0 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
ff1a2414 39pkill -USR1 dunst
a58ad2f0 40i3lock -nefi "$img"
41rm "$img"
ff1a2414 42pkill -USR2 dunst
This page took 0.053709 seconds and 4 git commands to generate.