2022-02-12 17:01:03 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if ! [[ -f /usr/bin/i3lock ]]; then
|
|
|
|
notify-send "no i3lock...install i3lock-color"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
# colors
|
2022-06-04 11:49:55 -05:00
|
|
|
bg_color=22212cbb
|
2022-02-12 17:01:03 -06:00
|
|
|
red=ff9580ff
|
|
|
|
cyan=80ffeaff
|
|
|
|
green=8aff80ff
|
|
|
|
orange=ffca80ff
|
|
|
|
selection=454158ff
|
|
|
|
|
|
|
|
# greeter config
|
|
|
|
font="MonoLisa Nerd Font:style=Bold"
|
|
|
|
greeter_msg="LOCKED"
|
|
|
|
|
|
|
|
ff=(
|
|
|
|
"Sub-Zero"
|
|
|
|
"3D-ASCII"
|
|
|
|
"big"
|
|
|
|
"small"
|
|
|
|
"lean"
|
|
|
|
"JS Bracket Letters"
|
|
|
|
"Epic"
|
|
|
|
"Fender"
|
|
|
|
"Slant"
|
|
|
|
"lineblocks"
|
|
|
|
"Marquee"
|
|
|
|
"Avatar"
|
|
|
|
"Contrast"
|
|
|
|
"amcrazor"
|
|
|
|
"Kban"
|
|
|
|
"Calvin S"
|
|
|
|
"Dr Pepper"
|
|
|
|
)
|
|
|
|
|
|
|
|
fig_font=${ff[RANDOM % ${#ff[@]}]}
|
|
|
|
|
|
|
|
make_figlet() {
|
|
|
|
figlet -f "$fig_font" "$greeter_msg"
|
|
|
|
}
|
|
|
|
|
|
|
|
font_size=25
|
2022-06-15 14:28:16 -05:00
|
|
|
font_to_px=$((font_size * 16 / 12))
|
|
|
|
greeter_h=$(($(make_figlet | wc -l) * font_to_px))
|
|
|
|
greeter_w=$(($(make_figlet | wc -L) * font_to_px))
|
2022-02-12 17:01:03 -06:00
|
|
|
|
|
|
|
greeter_pos="x+w/2-${greeter_w}/4:y+h/2-${greeter_h}/4"
|
|
|
|
|
2022-03-17 08:52:43 -05:00
|
|
|
# do the locking
|
2022-02-12 17:01:03 -06:00
|
|
|
|
2022-03-17 08:52:43 -05:00
|
|
|
# suspend message display
|
|
|
|
pkill -u "$USER" -USR1 dunst
|
|
|
|
sleep 0.1
|
2022-02-12 17:01:03 -06:00
|
|
|
|
2022-03-17 08:52:43 -05:00
|
|
|
# lock the screen
|
2022-02-12 17:01:03 -06:00
|
|
|
i3lock \
|
2022-06-15 14:28:16 -05:00
|
|
|
-n \
|
2022-02-12 17:01:03 -06:00
|
|
|
--screen 1 \
|
2022-06-15 14:28:16 -05:00
|
|
|
\
|
2022-02-12 17:01:03 -06:00
|
|
|
--color $bg_color \
|
2022-06-15 14:28:16 -05:00
|
|
|
--inside-color ffffff00 \
|
2022-02-12 17:01:03 -06:00
|
|
|
--ring-color $green \
|
|
|
|
--ringwrong-color $red \
|
|
|
|
--ringver-color $cyan \
|
|
|
|
--insidewrong-color $bg_color \
|
|
|
|
--insidever-color $bg_color \
|
2022-06-15 14:28:16 -05:00
|
|
|
--line-uses-ring \
|
|
|
|
--separator-color $selection \
|
2022-02-12 17:01:03 -06:00
|
|
|
--keyhl-color $cyan \
|
|
|
|
--bshl-color $red \
|
|
|
|
--wrong-color $red \
|
2022-06-15 14:28:16 -05:00
|
|
|
\
|
|
|
|
--ind-pos x+w-5-r:y+h-10-r \
|
|
|
|
--ring-width 25 \
|
|
|
|
--radius 100 \
|
2022-02-12 17:01:03 -06:00
|
|
|
--verif-text "" \
|
2022-06-15 14:28:16 -05:00
|
|
|
\
|
|
|
|
--greeter-text "$(make_figlet)" \
|
2022-02-12 17:01:03 -06:00
|
|
|
--greeter-font "${font}" \
|
|
|
|
--greeter-size $font_size \
|
|
|
|
--greeter-color $cyan \
|
2022-06-15 14:28:16 -05:00
|
|
|
--greeter-pos "${greeter_pos}" \
|
|
|
|
--greeter-align 1
|
2022-02-12 17:01:03 -06:00
|
|
|
|
2022-03-17 08:52:43 -05:00
|
|
|
# resume message display
|
|
|
|
pkill -u "$USER" -USR2 dunst
|