mass update.
[my-dotfiles.git] / bin / i3lock-fancy
CommitLineData
fdd76fc5 1#! /bin/bash
2
3CACHE=$HOME/.cache/i3lockblur
4TMPBG=$CACHE/screen.png
5NOW=$(date +'%d %b %Y')
6FACE=~/.face
7USER=$CACHE/face.png
8RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/')
9
10if [[ ! -d $CACHE ]]; then
11 mkdir -p $CACHE
12fi
13
14convert $FACE -resize 100x100 -alpha set \( \
15 +clone -distort DePolar 0 -virtual-pixel HorizontalTile \
16 -background None -distort Polar 0\
17 \) -compose Dst_In -composite -trim +repage $USER
18
19ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -i $USER \
20 -filter_complex "boxblur=7:15,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" \
21 -vframes 1 $TMPBG -loglevel quiet
22
23slowfade () {
24 dis=$(echo -n "$DISPLAY" | tr -c '[:alnum:]' _)
25 ifc='com.github.chjj.compton'
26 obj='/com/github/chjj/compton'
27 if [[ "$1" == "start" ]]; then
28 dbus-send --print-reply --dest=$ifc.$dis \
29 $obj $ifc.opts_set string:fade_in_step double:0.02
30 dbus-send --print-reply --dest=$ifc.$dis \
31 $obj $ifc.opts_set string:fade_out_step double:0.02
32 else
33 dbus-send --print-reply --dest=$ifc.$dis \
34 $obj $ifc.opts_set string:fade_in_step double:0.1
35 dbus-send --print-reply --dest=$ifc.$dis \
36 $obj $ifc.opts_set string:fade_out_step double:0.1
37 fi
38}
39
40FG_COLOR=fefefeff #fefefeff
41RING_COLOR=31313aff #31313aff
42WRONG_COLOR=f82a11aa #f82a11aa
43HLIGHT_COLOR=ffbf00ff #ffbf00ff
44VERIF_COLOR=fefefe66 #fefefe66
45
46slowfade start
47i3lock -n --force-clock -i $TMPBG \
48 --indpos="w/2:h/2" --timepos="w/2:h/2-170" --datepos="w/2:h/2-100" --greeterpos="w/2:h/2-70" \
49 --insidevercolor=$VERIF_COLOR --insidewrongcolor=$WRONG_COLOR --insidecolor=fefefe00 \
50 --ringvercolor=$VERIF_COLOR --ringwrongcolor=$WRONG_COLOR --ringcolor=$RING_COLOR \
51 --keyhlcolor=$HLIGHT_COLOR --bshlcolor=$HLIGHT_COLOR --separatorcolor=00000000 \
52 --datecolor=$FG_COLOR --timecolor=$FG_COLOR --greetercolor=$FG_COLOR \
53 --timestr="%H" --timesize=70 \
54 --datestr="%M" --datesize=70 \
55 --greetertext="$NOW" --greetersize=25\
56 --line-uses-inside --radius 50 --ring-width 2 --indicator \
57 --veriftext="" --wrongtext="" --noinputtext="" \
58 --clock --date-font="Roboto" --time-font="Roboto"
59sleep 1
60slowfade end