mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-07-16 05:49:49 +00:00
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:
+19
-3
@@ -150,6 +150,14 @@ is_installed() {
|
||||
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
|
||||
# ----------------------------------
|
||||
@@ -275,7 +283,10 @@ detect_network() {
|
||||
fi
|
||||
|
||||
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
|
||||
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]+\)//')
|
||||
@@ -508,6 +519,12 @@ _msg() {
|
||||
whiptail --title "$1" --msgbox "$2" "${3:-10}" "${4:-65}"
|
||||
}
|
||||
|
||||
_pause() {
|
||||
echo ""
|
||||
echo "Press [ENTER] to continue..."
|
||||
read -r
|
||||
}
|
||||
|
||||
# Blocks 2-4: clear → run → pause
|
||||
_run_cmd() {
|
||||
local title="$1" command="$2" success_msg="${3:-Running...}"
|
||||
@@ -522,8 +539,7 @@ _run_cmd() {
|
||||
else
|
||||
echo -e "${RED}[-]${NC} Failed (exit code: $rc)."
|
||||
fi
|
||||
echo "Press [ENTER] to continue..."
|
||||
read -r
|
||||
_pause
|
||||
}
|
||||
|
||||
# Blocks 1-4: confirm → clear → run → pause
|
||||
|
||||
Reference in New Issue
Block a user