add lockscreen script based on i3lock-color

This commit is contained in:
Daylin Morgan 2022-02-12 17:01:03 -06:00
parent 59509ae476
commit ad882ba895
2 changed files with 88 additions and 0 deletions

View file

@ -1,4 +1,5 @@
{{- if ne .chezmoi.hostname "thinkpad" }}
bin/lock
.xinitrc
.xprofile
.config/alacritty

View file

@ -0,0 +1,87 @@
#!/usr/bin/env bash
if ! [[ -f /usr/bin/i3lock ]]; then
notify-send "no i3lock...install i3lock-color"
exit
fi
# colors
bg_color=22212c88
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
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))
greeter_pos="x+w/2-${greeter_w}/4:y+h/2-${greeter_h}/4"
# do the locking
i3lock \
--screen 1 \
\
--color $bg_color \
--inside-color ffffff00 \
--ring-color $green \
--ringwrong-color $red \
--ringver-color $cyan \
--insidewrong-color $bg_color \
--insidever-color $bg_color \
--line-uses-ring \
--separator-color $selection \
--keyhl-color $cyan \
--bshl-color $red \
--wrong-color $red \
\
--ind-pos x+w-5-r:y+h-10-r \
--ring-width 25 \
--radius 100 \
--verif-text "" \
\
--greeter-text "$(make_figlet)" \
--greeter-font "${font}" \
--greeter-size $font_size \
--greeter-color $cyan \
--greeter-pos "${greeter_pos}" \
--greeter-align 1 \
# --indicator \
# --ind-pos x+w-5-r:y+h-10-r \
# --ind-pos x+w/2:y+h/2 \