UX Refactor: Pauses, Status & WiFi

- Implemented global `_pause()` logic across all modules (`utils`, `gaming`, `firmware`, etc.), replacing hardcoded `read -p` calls to standardize exit pauses.
- Unified MangoHud installation into a single command (`apt install -y mangohud:i386`) for gaming and legacy branches.
- Refactored `_inst()` to return `*` instead of `(installed)`, moving the function globally to `utils.sh` and removing duplicates from helpers.
- Enhanced Broadcom WiFi detection with expanded grep patterns ('network controller', 'wireless', etc.) and ID fallback (`14e4`).
- Updated `_run_cmd` to integrate the new pause logic for consistent workflow interruptions during script execution.
This commit is contained in:
stornic56
2026-06-27 00:21:09 -05:00
committed by GitHub
parent ad0b39e159
commit 8d1a05e3e0
12 changed files with 50 additions and 22 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ The submenu offers the next categories:
| **4** | Media Players | Multimedia playback with VLC media player and MPV for advanced video/audio support | | **4** | Media Players | Multimedia playback with VLC media player and MPV for advanced video/audio support |
| **5** | Multimedia & Design | image editing (GIMP), video editing (Kdenlive, HandBrake), 3D modeling (Blender), audio recording (Audacity), and graphics design (Inkscape) | | **5** | Multimedia & Design | image editing (GIMP), video editing (Kdenlive, HandBrake), 3D modeling (Blender), audio recording (Audacity), and graphics design (Inkscape) |
| **6** | Code Editors & IDEs | vim, vim-gtk3, Neovim, Helix, nano, Emacs, Kate, Mousepad, Gedit, Geany, GNOME Text Editor, and VSCodium (VS Code open-source) | | **6** | Code Editors & IDEs | vim, vim-gtk3, Neovim, Helix, nano, Emacs, Kate, Mousepad, Gedit, Geany, GNOME Text Editor, and VSCodium (VS Code open-source) |
| **7** | Servers & Dev Tools | Web servers (Nginx/Apache), databases (PostgreSQL/MariaDB), Java Development Kit (Temurin 17/21/25 JDK), Docker, Python, SSH tools, fail2ban, Jellyfin Server and essential utilities | | **7** | Servers & Dev Tools | Web servers (Nginx/Apache), databases (PostgreSQL/MariaDB), Java Development Kit (Temurin 17/21/25 JDK), Docker, Python, SSH tools, Jellyfin Server and essential utilities |
| **8** | Security & Networking | Wireshark, tcpdump, Zenmap, ClamAV, UFW, Fail2ban | | **8** | Security & Networking | Wireshark, tcpdump, Zenmap, ClamAV, UFW, fail2ban |
| **9** | Software Centers | Choose a software store to install. | | **9** | Software Centers | Choose a software store to install. |
| **10** | System Tools | htop/btop, ncdu, Timeshift, tmux/screen, nvme-cli, Flatpak support, extension repository manager and qemu/virtmanager | | **10** | System Tools | htop/btop, ncdu, Timeshift, tmux/screen, nvme-cli, Flatpak support, extension repository manager and qemu/virtmanager |
| **11** | Fetch / System Info | fastfetch/neofetch, hyfetch, Linux logo and screenfetch | | **11** | Fetch / System Info | fastfetch/neofetch, hyfetch, Linux logo and screenfetch |
+2
View File
@@ -490,6 +490,7 @@ _cat_general_bullseye() {
if _confirm "Firmware Scan" "Scan for firmware updates now?"; then if _confirm "Firmware Scan" "Scan for firmware updates now?"; then
sudo fwupdmgr refresh --force 2>/dev/null || true sudo fwupdmgr refresh --force 2>/dev/null || true
sudo fwupdmgr get-updates 2>&1 || true sudo fwupdmgr get-updates 2>&1 || true
_pause
fi fi
;; ;;
nvme-cli) nvme-cli)
@@ -505,6 +506,7 @@ _cat_general_bullseye() {
esac esac
done done
echo -e "${GREEN}System tools installed.${NC}" echo -e "${GREEN}System tools installed.${NC}"
_pause
} }
_cat_fetch_bullseye() { _cat_fetch_bullseye() {
+5 -3
View File
@@ -175,6 +175,7 @@ Installs matching 32-bit graphics drivers."; then
if [ -z "$choices" ]; then if [ -z "$choices" ]; then
echo "No gaming tools selected." echo "No gaming tools selected."
_pause
return return
fi fi
@@ -184,16 +185,16 @@ Installs matching 32-bit graphics drivers."; then
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
mangohud) mangohud)
_run_cmd "MangoHud" "sudo apt install -y mangohud" "Installing MangoHud..." local mh_pkgs="mangohud"
if $enable_32bit; then if $enable_32bit; then
local mh32_ver local mh32_ver
mh32_ver=$(apt-cache policy mangohud:i386 2>/dev/null | \ mh32_ver=$(apt-cache policy mangohud:i386 2>/dev/null | \
awk 'NR==3 {print $2; exit}') awk 'NR==3 {print $2; exit}')
if [ -n "$mh32_ver" ] && [ "$mh32_ver" != "(none)" ]; then if [ -n "$mh32_ver" ] && [ "$mh32_ver" != "(none)" ]; then
_run_cmd "MangoHud" "sudo apt install -y mangohud:i386" \ mh_pkgs+=" mangohud:i386"
"Installing MangoHud 32-bit..."
fi fi
fi fi
_run_cmd "MangoHud" "sudo apt install -y $mh_pkgs" "Installing MangoHud (64 + 32-bit)..."
;; ;;
gamemode) _run_cmd "GameMode" "sudo apt install -y gamemode" "Installing GameMode..." ;; gamemode) _run_cmd "GameMode" "sudo apt install -y gamemode" "Installing GameMode..." ;;
goverlay) _run_cmd "GOverlay" "sudo apt install -y goverlay" "Installing GOverlay..." ;; goverlay) _run_cmd "GOverlay" "sudo apt install -y goverlay" "Installing GOverlay..." ;;
@@ -204,4 +205,5 @@ Installs matching 32-bit graphics drivers."; then
done done
echo -e "${GREEN}Lightweight gaming setup complete.${NC}" echo -e "${GREEN}Lightweight gaming setup complete.${NC}"
_pause
} }
+1 -8
View File
@@ -1,14 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Shared helpers for extras categories # Shared helpers for extras categories
_inst() {
if is_installed "$1"; then echo " (installed)"; else echo ""; fi
}
_state() {
is_installed "$1" && echo "ON" || echo "OFF"
}
_install_clamav() { _install_clamav() {
if is_installed "clamav"; then if is_installed "clamav"; then
echo "ClamAV already installed." echo "ClamAV already installed."
@@ -21,6 +13,7 @@ _install_clamav() {
sudo systemctl stop clamav-freshclam 2>/dev/null || true sudo systemctl stop clamav-freshclam 2>/dev/null || true
sudo freshclam || true sudo freshclam || true
sudo systemctl start clamav-freshclam 2>/dev/null || true sudo systemctl start clamav-freshclam 2>/dev/null || true
_pause
fi fi
if _confirm "ClamAV" "Run quick scan on /bin to verify engine works?"; then if _confirm "ClamAV" "Run quick scan on /bin to verify engine works?"; then
+5 -2
View File
@@ -180,12 +180,15 @@ _cat_general() {
_run_cmd "fwupd" "sudo fwupdmgr update -y" "Installing firmware updates..." _run_cmd "fwupd" "sudo fwupdmgr update -y" "Installing firmware updates..."
else else
echo "Skipping firmware update." echo "Skipping firmware update."
_pause
fi fi
else else
echo "No firmware updates available." echo "No firmware updates available."
_pause
fi fi
fi fi
echo -e "${GREEN}fwupd setup complete.${NC}" echo -e "${GREEN}fwupd setup complete.${NC}"
_pause
;; ;;
kvm) kvm)
if ! is_installed "virt-manager"; then if ! is_installed "virt-manager"; then
@@ -250,8 +253,7 @@ _cat_general() {
echo -e " ${GREEN}Percentage Used:${NC} ${pu:-N/A}" echo -e " ${GREEN}Percentage Used:${NC} ${pu:-N/A}"
echo "" echo ""
done done
echo "Press [ENTER] to continue..." _pause
read -r
fi fi
;; ;;
*) *)
@@ -269,5 +271,6 @@ _cat_general() {
done done
echo -e "${GREEN}System tools installed.${NC}" echo -e "${GREEN}System tools installed.${NC}"
_pause
} }
+5
View File
@@ -268,6 +268,7 @@ _handle_wireless() {
_run_cmd "Broadcom" "sudo DEBIAN_FRONTEND=noninteractive apt install -y linux-headers-$(uname -r) broadcom-sta-dkms" \ _run_cmd "Broadcom" "sudo DEBIAN_FRONTEND=noninteractive apt install -y linux-headers-$(uname -r) broadcom-sta-dkms" \
"Installing Broadcom driver..." "Installing Broadcom driver..."
echo "Broadcom proprietary driver installed. A reboot may be required." echo "Broadcom proprietary driver installed. A reboot may be required."
_pause
installed_any=true installed_any=true
fi fi
fi fi
@@ -281,6 +282,7 @@ _handle_wireless() {
if ! $installed_any; then if ! $installed_any; then
echo "No special WiFi firmware needed -- base firmware-linux-nonfree covers this system." echo "No special WiFi firmware needed -- base firmware-linux-nonfree covers this system."
_pause
fi fi
} }
@@ -307,6 +309,7 @@ main menu to install proprietary firmwares." 10 65
# 3. Confirm # 3. Confirm
if ! _confirm "Firmware" "Apply the network & firmware plan?"; then if ! _confirm "Firmware" "Apply the network & firmware plan?"; then
echo "Firmware installation skipped." echo "Firmware installation skipped."
_pause
return return
fi fi
@@ -328,6 +331,7 @@ main menu to install proprietary firmwares." 10 65
fi fi
else else
echo "$fw_pkg already installed." echo "$fw_pkg already installed."
_pause
fi fi
else else
local msg="firmware-linux-nonfree provides hardware drivers for:\n" local msg="firmware-linux-nonfree provides hardware drivers for:\n"
@@ -366,4 +370,5 @@ main menu to install proprietary firmwares." 10 65
# 8. Summary # 8. Summary
echo -e "${GREEN}Network & firmware setup complete.${NC}" echo -e "${GREEN}Network & firmware setup complete.${NC}"
_pause
} }
+2
View File
@@ -151,6 +151,7 @@ install_gaming() {
if [ -z "$choices" ]; then if [ -z "$choices" ]; then
echo "No gaming packages selected." echo "No gaming packages selected."
_pause
return return
fi fi
@@ -192,4 +193,5 @@ install_gaming() {
done done
echo -e "${GREEN}Gaming setup complete.${NC}" echo -e "${GREEN}Gaming setup complete.${NC}"
_pause
} }
+5 -4
View File
@@ -2,11 +2,11 @@
# Gaming performance tools installation # Gaming performance tools installation
install_mangohud() { install_mangohud() {
_run_cmd "MangoHud" "sudo apt install -y mangohud" "Installing MangoHud..." local pkgs="mangohud"
if dpkg --print-foreign-architectures | grep -q i386; then if dpkg --print-foreign-architectures | grep -q i386; then
echo "Installing 32-bit MangoHud..." pkgs+=" mangohud:i386"
_run_cmd "MangoHud" "sudo apt install -y mangohud:i386" "Installing 32-bit MangoHud..."
fi fi
_run_cmd "MangoHud" "sudo apt install -y $pkgs" "Installing MangoHud (64 + 32-bit)..."
} }
install_gamemode() { install_gamemode() {
@@ -60,6 +60,7 @@ install_openrgb() {
rm -f "${deb_path}" rm -f "${deb_path}"
echo -e "${GREEN}OpenRGB installed. NOTE: You must reboot or log out/in for the 'i2c' group to take effect.${NC}" echo -e "${GREEN}OpenRGB installed. NOTE: You must reboot or log out/in for the 'i2c' group to take effect.${NC}"
_pause
} }
install_retroarch() { install_retroarch() {
@@ -86,5 +87,5 @@ install_retroarch() {
echo " Please check our repository's documentation or visit:" echo " Please check our repository's documentation or visit:"
echo " https://wiki.debian.org/RetroArch" echo " https://wiki.debian.org/RetroArch"
echo "=================================================================" echo "================================================================="
read -p "Press ENTER to continue..." _pause
} }
+1
View File
@@ -27,4 +27,5 @@ install_kernel_backports() {
_run_cmd "Kernel" "sudo apt install -y -t ${DEBIAN_CODENAME}-backports linux-image-amd64" "Installing kernel from backports..." _run_cmd "Kernel" "sudo apt install -y -t ${DEBIAN_CODENAME}-backports linux-image-amd64" "Installing kernel from backports..."
echo -e "${GREEN}Kernel installed. Reboot to use it.${NC}" echo -e "${GREEN}Kernel installed. Reboot to use it.${NC}"
_pause
} }
+2
View File
@@ -402,6 +402,7 @@ Mesa versions without compromising overall system stability." 16 70; then
sudo apt autoremove -y sudo apt autoremove -y
sudo apt autoclean sudo apt autoclean
echo -e "${GREEN}System upgraded.${NC}" echo -e "${GREEN}System upgraded.${NC}"
_pause
else else
echo "Skipping upgrade." echo "Skipping upgrade."
fi fi
@@ -409,6 +410,7 @@ Mesa versions without compromising overall system stability." 16 70; then
else else
restore_previous_repos restore_previous_repos
echo -e "${RED}apt update failed. Previous repository configuration restored.${NC}" echo -e "${RED}apt update failed. Previous repository configuration restored.${NC}"
_pause
return 1 return 1
fi fi
} }
+19 -3
View File
@@ -150,6 +150,14 @@ is_installed() {
dpkg -l "$1" 2>/dev/null | grep -q '^ii' dpkg -l "$1" 2>/dev/null | grep -q '^ii'
} }
_inst() {
if is_installed "$1"; then echo " *"; else echo ""; fi
}
_state() {
is_installed "$1" && echo "ON" || echo "OFF"
}
# ---------------------------------- # ----------------------------------
# Package version lookup # Package version lookup
# ---------------------------------- # ----------------------------------
@@ -275,7 +283,10 @@ detect_network() {
fi fi
local wifi_line local wifi_line
wifi_line=$(lspci -nn | grep -i 'Network controller' | head -n1) || true wifi_line=$(lspci -nn | grep -iE 'network controller|wireless|wi-fi|wlan|802\.11' | head -n1) || true
if [ -z "$wifi_line" ]; then
wifi_line=$(lspci -nn | grep -i '14e4:' | head -n1) || true
fi
if [ -n "$wifi_line" ]; then if [ -n "$wifi_line" ]; then
WIFI_CHIPSET="$wifi_line" WIFI_CHIPSET="$wifi_line"
WIFI_DESC=$(echo "$wifi_line" | sed -E 's/^.*\]: //; s/ \[[0-9a-fA-F]{4}:[0-9a-fA-F]{4}\]//; s/ \(rev [0-9a-fA-F]+\)//') WIFI_DESC=$(echo "$wifi_line" | sed -E 's/^.*\]: //; s/ \[[0-9a-fA-F]{4}:[0-9a-fA-F]{4}\]//; s/ \(rev [0-9a-fA-F]+\)//')
@@ -508,6 +519,12 @@ _msg() {
whiptail --title "$1" --msgbox "$2" "${3:-10}" "${4:-65}" whiptail --title "$1" --msgbox "$2" "${3:-10}" "${4:-65}"
} }
_pause() {
echo ""
echo "Press [ENTER] to continue..."
read -r
}
# Blocks 2-4: clear → run → pause # Blocks 2-4: clear → run → pause
_run_cmd() { _run_cmd() {
local title="$1" command="$2" success_msg="${3:-Running...}" local title="$1" command="$2" success_msg="${3:-Running...}"
@@ -522,8 +539,7 @@ _run_cmd() {
else else
echo -e "${RED}[-]${NC} Failed (exit code: $rc)." echo -e "${RED}[-]${NC} Failed (exit code: $rc)."
fi fi
echo "Press [ENTER] to continue..." _pause
read -r
} }
# Blocks 1-4: confirm → clear → run → pause # Blocks 1-4: confirm → clear → run → pause
+1
View File
@@ -65,4 +65,5 @@ EOF
sudo zramctl sudo zramctl
echo "" echo ""
echo -e "${GREEN}You can verify with: sudo zramctl${NC}" echo -e "${GREEN}You can verify with: sudo zramctl${NC}"
_pause
} }