feat(dwmtitus-setup): improve slstatus installation using loop

This commit is contained in:
Mayur Raut 2024-09-15 19:04:39 +05:30
parent 65f26795bb
commit b46569c38b
No known key found for this signature in database
GPG Key ID: 1859B801BFC1AB98

View File

@ -296,6 +296,7 @@ setupDisplayManager() {
} }
install_slstatus() { install_slstatus() {
while true; do
printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX
read -r response # -r flag to prevent backslashes from being interpreted read -r response # -r flag to prevent backslashes from being interpreted
case "$response" in case "$response" in
@ -308,15 +309,17 @@ install_slstatus() {
echo "Failed to install slstatus" echo "Failed to install slstatus"
return 1 return 1
fi fi
break
;; ;;
[Nn] | [Nn][Oo]) # same logic as above, but for No [Nn] | [Nn][Oo]) # same logic as above, but for No
echo "Skipping slstatus installation" echo "Skipping slstatus installation"
break
;; ;;
*) *)
echo "Invalid input. Please enter y/yes or n/no." echo "Invalid input. Please enter y/yes or n/no."
install_slstatus
;; ;;
esac esac
done
cd .. cd ..
} }