feat(dwmtitus-setup): simplified

This commit is contained in:
Mayur Raut 2024-09-15 19:16:43 +05:30
parent b46569c38b
commit 3026b757e0
No known key found for this signature in database
GPG Key ID: 1859B801BFC1AB98

View File

@ -296,30 +296,20 @@ 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 if [ "$response" = "y" ] || [ "$response" = "Y" ]; then
case "$response" in echo "Installing slstatus"
[Yy] | [Yy][Ee][Ss]) # Matches: Y, y, Yes, yes, YES, yEs, yeS, etc. cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; }
echo "Installing slstatus" if $ESCALATION_TOOL make clean install; then
cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; } echo "slstatus installed successfully"
if $ESCALATION_TOOL make clean install; then else
echo "slstatus installed successfully" echo "Failed to install slstatus"
else return 1
echo "Failed to install slstatus" fi
return 1 else
fi echo "Skipping slstatus installation"
break fi
;;
[Nn] | [Nn][Oo]) # same logic as above, but for No
echo "Skipping slstatus installation"
break
;;
*)
echo "Invalid input. Please enter y/yes or n/no."
;;
esac
done
cd .. cd ..
} }