Replace I38 installer with removal action
Change the configure-stormux menu from installing I38 to removing it, since new Stormux images now ship I38 by default. Add a dedicated removal helper that disables nodm, removes installed I38/XLibre desktop packages when present, handles stale pacman locks safely, and optionally purges generated I38 user configuration. Remove the now-unused architecture probe from the main menu script after dropping the GUI installation path.
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$(whoami)" == "root" ]]; then
|
||||
msgbox "Please run configure-stormux as your user, not as root."
|
||||
return 1
|
||||
fi
|
||||
|
||||
sudoFlags=("${sudoFlags[@]}")
|
||||
|
||||
confirmRemoval="$(yesno "This will remove the I38 desktop, disable GUI startup, remove the XLibre desktop packages installed for I38, and delete generated I38 configuration from your account. Continue?")"
|
||||
if [[ "$confirmRemoval" != "Yes" ]]; then
|
||||
msgbox "I38 removal cancelled."
|
||||
return 0
|
||||
fi
|
||||
|
||||
sudo "${sudoFlags[@]}" systemctl disable --now nodm.service 2> /dev/null || true
|
||||
|
||||
if [[ -f /var/lib/pacman/db.lck ]]; then
|
||||
removeLock="$(yesno "A pacman database lock was found at /var/lib/pacman/db.lck. If no package manager is running, it is usually safe to remove. Remove it and continue?")"
|
||||
if [[ "$removeLock" == "Yes" ]]; then
|
||||
sudo "${sudoFlags[@]}" rm -f /var/lib/pacman/db.lck
|
||||
else
|
||||
msgbox "Cannot safely remove packages while the pacman database is locked."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
packages=(
|
||||
i38
|
||||
cthulhu
|
||||
nodm-dgw
|
||||
xlibre-input-libinput
|
||||
xlibre-video-dummy-with-vt
|
||||
xlibre-video-fbdev
|
||||
xlibre-xserver
|
||||
xorg-xinit
|
||||
)
|
||||
|
||||
installedPackages=()
|
||||
for packageName in "${packages[@]}"; do
|
||||
if pacman -Q "$packageName" > /dev/null 2>&1; then
|
||||
installedPackages+=("$packageName")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#installedPackages[@]} -gt 0 ]]; then
|
||||
yay --sudoflags "${sudoFlags[@]}" --noconfirm -Rns "${installedPackages[@]}"
|
||||
fi
|
||||
|
||||
removeConfig="$(yesno "Delete generated I38 files from $HOME? This removes ~/.config/i3, ~/.xinitrc, ~/.xprofile, and ~/git/I38 if present.")"
|
||||
if [[ "$removeConfig" == "Yes" ]]; then
|
||||
rm -rf -- "$HOME/.config/i3" "$HOME/.xinitrc" "$HOME/.xprofile" "$HOME/git/I38"
|
||||
fi
|
||||
|
||||
msgbox "I38 removal is complete. Reboot before relying on the new console-only startup state."
|
||||
@@ -62,9 +62,6 @@ fi
|
||||
source .includes/functions.sh
|
||||
# Include the dialog based UI
|
||||
source .includes/ui.sh
|
||||
# Get architecture
|
||||
architecture="$(uname -m)"
|
||||
|
||||
# Make sure basic xdg directory structure is in place:
|
||||
if [[ ! -d ~/Desktop ]]; then
|
||||
xdg-user-dirs-update
|
||||
@@ -99,8 +96,8 @@ while [[ "$choice" != "Exit" ]]; do
|
||||
yay -R --noconfirm linux-rpi
|
||||
install_package linux-rpi-16k
|
||||
;;
|
||||
"Install I38 Desktop")
|
||||
source .includes/gui.sh i3
|
||||
"Remove I38 Desktop")
|
||||
source .includes/remove-i38.sh
|
||||
;;
|
||||
"Screen reader")
|
||||
source .includes/screenreader.sh
|
||||
@@ -139,7 +136,7 @@ while [[ "$choice" != "Exit" ]]; do
|
||||
if [[ "${raspberryPiVersion%%0*}" == "Raspberry Pi 5" ]] && ! pacman -Q linux-rpi-16k &> /dev/null ; then
|
||||
options+=("Install Raspberry Pi 5 kernel")
|
||||
fi
|
||||
options+=("Install I38 Desktop"
|
||||
options+=("Remove I38 Desktop"
|
||||
"Screen reader"
|
||||
)
|
||||
options+=("Set timezone"
|
||||
|
||||
Reference in New Issue
Block a user