merge both image-lock.sh and image-lock-sleep.sh in swaylock-script

This commit is contained in:
primardj 2024-01-22 18:40:27 +00:00
parent e425446e57
commit 184cebcfeb

View file

@ -10,7 +10,7 @@ PARAMETTER
-h, --help Print this help message and quit
-v, --version Print the version and quit
--sleep Launch the script without waiting anytime
--swaylock-effects Lauch the swaylock effects options.
--swaylock-only Lauch the locker with swaylock original options.
"
for i in $@; do
@ -23,6 +23,43 @@ for i in $@; do
echo "swaylock-script $Version"
exit 0
;;
"--sleep")
sleep_flag="set"
;;
"--swaylock-only")
sw_effects="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"
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_effects}" == "set" ]
then
swaylock ${option_sw}
echo "ici"
else
swaylock ${option_sw_effects}
fi