-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlock.sh
More file actions
executable file
·38 lines (31 loc) · 1.13 KB
/
Copy pathlock.sh
File metadata and controls
executable file
·38 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
rectangles=" "
timeout="10000"
SR=$(xrandr --query | grep ' connected' | grep -o '[0-9][0-9]*x[0-9][0-9]*[^ ]*')
for RES in $SR; do
SRA=(${RES//[x+]/ })
CX=$((${SRA[2]} + 25))
CY=$((${SRA[1]} - 50))
rectangles+="rectangle $CX,$CY $((CX+380)),$((CY-120)) "
done
TMPBG=/tmp/screen.png
scrot $TMPBG && convert $TMPBG -scale 5% -scale 2000% -draw "fill black fill-opacity 0.4 $rectangles" $TMPBG
i3lock \
-i $TMPBG \
--time-pos="x+90:h-60" \
--date-pos="tx+24:ty+25" \
--clock --date-str "Type password to unlock..." \
--inside-color=00000000 --ring-color=ffffffff --line-uses-inside \
--keyhl-color=d23c3dff --bshl-color=d23c3dff --separator-color=00000000 \
--insidever-color=fecf4dff --insidewrong-color=d23c3dff \
--ringver-color=ffffffff --ringwrong-color=ffffffff --ind-pos="x+250:h-60" \
--radius=20 --ring-width=3 --verif-text="" --wrong-text="" \
--time-color="ffffffff" --date-color="ffffffff" -n &
sleep 1
rm $TMPBG
# Pauses music if played
#playerctl pause
# If still locked after 10000ms, turn off screen
while [[ $(pgrep i3lock) ]]; do
[[ $timeout -lt $(xssstate -i) ]] && xset dpms force off
done