dotfiles/dotconfig/bin/swaylock-script

66 lines
1.3 KiB
Text
Raw Normal View History

2024-07-20 22:10:54 +02:00
#!/usr/bin/bash
# Definition of constantes.
Version="1.0.1"
Usage="swaylock-script [ PARAMETTER ]
script who lock a computer by my own options.
PARAMETTER
-h, --help Print this help message and quit
-v, --version Print the version and quit
--sleep Launch the script without waiting anytime
--swaylock-only Lauch the locker with swaylock original options.
"
for i in "$@"; do
case "$i" in
"-h" | "--help")
echo "$Usage"
exit 0
;;
"-v" | "--version")
echo "swaylock-script $Version"
exit 0
;;
"--sleep")
sleep_flag="set"
;;
"--swaylock-only")
sw_only="set"
;;
esac
done
option_sw_effects="-f \
--screenshots \
--clock \
--indicator \
--indicator-radius 200 \
--indicator-thickness 10 \
--inside-color 000000BB \
--effect-vignette 0.6:1 \
--effect-blur 3x5 \
--ring-color ff7f50 \
--separator-color 000000ff \
--timestr %I:%M-%p"
option_sw=""
if [ ! "${sleep_flag}" == "set" ]
then
option_sw_effects="${option_sw_effects} \
--fade-in 4"
# no options_sw because I hadden't had time to add them.
fi
if [ "${sw_only}" == "set" ]
then
swaylock ${option_sw}
else
swaylock ${option_sw_effects}
fi