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