forked from meskarune/i3lock-fancy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlock
executable file
·24 lines (18 loc) · 948 Bytes
/
lock
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Dependencies:
# ffmpeg
# i3lock-color-git
IMAGE=/tmp/i3lock.png
TEXT="locked"
SCRIPT=`realpath $0`
SCRIPTPATH=`dirname $SCRIPT`
LOCK=$SCRIPTPATH/lock.png
RES=$(xrandr --current | grep '*' | uniq | awk '{print $1}')
#This is a bit cheaty
BOXSIZE=$(expr $(echo $RES | cut -d 'x' -f1) / 2)
if [[ $1 != "" ]]; then
TEXT=$1
fi
ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -i $LOCK -filter_complex "boxblur=5,drawtext=fontfile=$SCRIPTPATH/Digital_tech.otf:text=$TEXT:fontcolor='#ffffffe0':fontsize=40:x=(w-tw)/2:y=(h/PHI)+th:shadowcolor='#1d1f21d0':shadowx=2:shadowy=2:box=1:boxcolor=#1a1b22@0.4:boxborderw=$BOXSIZE,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -vframes 1 $IMAGE
i3lock --textcolor=ffffff00 --insidecolor=ffffff1c --ringcolor=ffffff3e --linecolor=ffffff00 --keyhlcolor=00000080 --ringvercolor=00000000 --insidevercolor=0000001c --ringwrongcolor=00000055 --insidewrongcolor=0000001c -i $IMAGE
rm $IMAGE