Skip to content

Commit 728c14e

Browse files
Fix shell check and a few errors in WM install
1 parent 12cbb80 commit 728c14e

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

core/tabs/system-setup/desktop-environments-uninstall.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ uninstall_desktop() {
392392

393393
echo "Uninstalling $desktop..."
394394
echo "Removing packages..."
395-
uninstall_packages "$pkg_manager" $packages
395+
uninstall_packages "$pkg_manager" "$packages"
396396

397397
echo "Cleaning up configuration files..."
398398
for dir in $config_dirs; do
@@ -409,7 +409,7 @@ uninstall_desktop() {
409409
$ESCALATION_TOOL "$pkg_manager" clean || true
410410
;;
411411
"pacman")
412-
$ESCALATION_TOOL $AUR_HELPER -Scc --noconfirm || true
412+
$ESCALATION_TOOL "$AUR_HELPER" -Scc --noconfirm || true
413413
;;
414414
"dnf")
415415
$ESCALATION_TOOL "$pkg_manager" autoremove -y || true
@@ -443,7 +443,7 @@ main() {
443443
fi
444444
done
445445

446-
set -- $INSTALLED_DESKTOPS
446+
set -- "$INSTALLED_DESKTOPS"
447447
if [ $# -eq 0 ]; then
448448
echo "No supported desktop environments or window managers detected as installed."
449449
exit 0
@@ -459,7 +459,7 @@ main() {
459459
echo "q) Quit"
460460

461461
printf "Enter your choice: "
462-
read choice
462+
read -r choice
463463

464464
case "$choice" in
465465
'' | *[!0-9]*)
@@ -472,7 +472,7 @@ main() {
472472
fi
473473
;;
474474
*)
475-
set -- $INSTALLED_DESKTOPS
475+
set -- "$INSTALLED_DESKTOPS"
476476
selected_de=$(printf "%s\n" "$@" | sed -n "${choice}p")
477477
if [ -n "$selected_de" ]; then
478478
uninstall_desktop "$PACKAGER" "$selected_de"

core/tabs/system-setup/desktop-environments.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
install_packages() {
77
pkg_manager=$1
88
shift
9-
# shellcheck disable=SC2086
10-
case $pkg_manager in
9+
case "$pkg_manager" in
1110
paru | yay)
1211
$pkg_manager -S --needed --noconfirm "$@"
1312
;;
1413
pacman)
15-
$ESCALATION_TOOL $pkg_manager -S --needed --noconfirm "$@"
14+
$ESCALATION_TOOL "$pkg_manager" -S --needed --noconfirm "$@"
1615
;;
1716
apt-get | nala | dnf | zypper)
18-
$ESCALATION_TOOL $pkg_manager install -y "$@"
17+
$ESCALATION_TOOL "$pkg_manager" install -y "$@"
1918
;;
2019
esac
2120
}
@@ -145,7 +144,7 @@ main() {
145144
printf "%s\n" " 2. Install Window Manager "
146145
printf "%s\n" " 3. Exit "
147146
printf "%s" " Please select an option (1-3): "
148-
read choice
147+
read -r choice
149148

150149
case "$choice" in
151150
1)
@@ -159,7 +158,7 @@ main() {
159158
printf "%s\n" " 7. LXQt "
160159
printf "%s\n" " 8. LXDE "
161160
printf "%s" " Please select a desktop environment (1-8): "
162-
read de_choice
161+
read -r de_choice
163162
case "$de_choice" in
164163
1) installDesktopEnvironment gnome ;;
165164
2) installDesktopEnvironment kde ;;
@@ -183,10 +182,8 @@ main() {
183182
printf "%s\n" " 7. Fluxbox "
184183
printf "%s\n" " 8. Niri "
185184
printf "%s\n" " 9. HyDE "
186-
printf "%s\n" " 10. Miracle (currently not stable for daily use!) "
187-
printf "%s\n" " 11. River (currently not stable for daily use!) "
188-
printf "%s" " Please select a window manager (1-7): "
189-
read wm_choice
185+
printf "%s" " Please select a window manager (1-9): "
186+
read -r wm_choice
190187
case "$wm_choice" in
191188
1) installWindowManager i3 ;;
192189
2) installWindowManager sway ;;
@@ -197,8 +194,6 @@ main() {
197194
7) installWindowManager fluxbox ;;
198195
8) installWindowManager niri ;;
199196
9) installWindowManager hyde ;;
200-
9) installWindowManager miracle-wm ;;
201-
9) installWindowManager river ;;
202197
*) printf "%s\n" "$RED Invalid selection " ;;
203198
esac
204199
;;

0 commit comments

Comments
 (0)