dual-gpu fix & lspci cache

- Replaced the restrictive Broadcom firmware installation flow with a persistent, step-by-step process in modules/firmware.sh. Now installs dkms, wireless-tools, and linux-headers-amd64 separately, then applies blacklist configuration, updates initramfs, and loads conflicting modules properly.
- Fixed conky package name across system.sh and bullseye/extras.sh. Changed from "conky" to "conky-all" with corresponding state variable updates for correct installation via apt.
- Corrected broken GRUB sed command in modules/gpu.sh for AMD GCN support. Added grep guard to prevent duplicate parameter insertion and fixed regex pattern for proper cmdline modification.
- Added whiptail pre-flight check in debianito.sh. Auto-installs required TUI dependencies if missing before the main menu, preventing runtime failures.
- Fixed home directory path resolution bug in modules/sudo_config.sh. Replaced eval echo "~$USER" with getent passwd approach for reliable user home detection across SUDO_USER contexts.
- Implemented global lspci output caching across 18+ locations. Single cache population via _init_lspci_cache() before detect_gpu, all subsequent reads use LSPCI_OUTPUT variable to eliminate redundant hardware polling calls.
- Added apt update deduplication helper in modules/utils.sh. _ensure_apt_updated() with APT_UPDATED flag bypasses redundant package list refreshes across extras/, gaming/, firmware/, and desktop_display/ modules while preserving transactional rollback paths in repos.sh.
- Fixed STATE_REFRESHED logic in debianito.sh main_menu case statement. Added STATE_REFRESHED=true to branches 3, 5, 7, 9, 11, 12, and 13 that mutate system state, ensuring refresh_system_state() triggers correctly after configuration changes.
- Removed dead REPOS_CONFIGURED variable from debianito.sh and modules/repos.sh. Variable was written but never read, eliminated to clean up global namespace without affecting repository functionality.
This commit is contained in:
stornic56
2026-08-27 01:41:33 -05:00
committed by GitHub
parent 0eacdc095f
commit 8c922ee424
19 changed files with 1510 additions and 1300 deletions
+92 -65
View File
@@ -17,20 +17,20 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODULES_DIR="${SCRIPT_DIR}/modules" MODULES_DIR="${SCRIPT_DIR}/modules"
source "${MODULES_DIR}/utils.sh" source "${MODULES_DIR}/utils.sh"
[ -f "${MODULES_DIR}/sysinfo.sh" ] && source "${MODULES_DIR}/sysinfo.sh" [ -f "${MODULES_DIR}/sysinfo.sh" ] && source "${MODULES_DIR}/sysinfo.sh"
source "${MODULES_DIR}/sudo_config.sh" source "${MODULES_DIR}/sudo_config.sh"
source "${MODULES_DIR}/repos/repo_detect.sh" source "${MODULES_DIR}/repos/repo_detect.sh"
source "${MODULES_DIR}/repos.sh" source "${MODULES_DIR}/repos.sh"
[ -f "${MODULES_DIR}/firmware.sh" ] && source "${MODULES_DIR}/firmware.sh" [ -f "${MODULES_DIR}/firmware.sh" ] && source "${MODULES_DIR}/firmware.sh"
[ -f "${MODULES_DIR}/bluetooth.sh" ] && source "${MODULES_DIR}/bluetooth.sh" [ -f "${MODULES_DIR}/bluetooth.sh" ] && source "${MODULES_DIR}/bluetooth.sh"
[ -f "${MODULES_DIR}/gpu.sh" ] && source "${MODULES_DIR}/gpu.sh" [ -f "${MODULES_DIR}/gpu.sh" ] && source "${MODULES_DIR}/gpu.sh"
[ -f "${MODULES_DIR}/kernel.sh" ] && source "${MODULES_DIR}/kernel.sh" [ -f "${MODULES_DIR}/kernel.sh" ] && source "${MODULES_DIR}/kernel.sh"
[ -f "${MODULES_DIR}/gaming.sh" ] && source "${MODULES_DIR}/gaming.sh" [ -f "${MODULES_DIR}/gaming.sh" ] && source "${MODULES_DIR}/gaming.sh"
[ -f "${MODULES_DIR}/extras.sh" ] && source "${MODULES_DIR}/extras.sh" [ -f "${MODULES_DIR}/extras.sh" ] && source "${MODULES_DIR}/extras.sh"
[ -f "${MODULES_DIR}/zram.sh" ] && source "${MODULES_DIR}/zram.sh" [ -f "${MODULES_DIR}/zram.sh" ] && source "${MODULES_DIR}/zram.sh"
[ -f "${MODULES_DIR}/extras/java.sh" ] && source "${MODULES_DIR}/extras/java.sh" [ -f "${MODULES_DIR}/extras/java.sh" ] && source "${MODULES_DIR}/extras/java.sh"
[ -f "${MODULES_DIR}/rescue.sh" ] && source "${MODULES_DIR}/rescue.sh" [ -f "${MODULES_DIR}/rescue.sh" ] && source "${MODULES_DIR}/rescue.sh"
[ -f "${MODULES_DIR}/swap.sh" ] && source "${MODULES_DIR}/swap.sh" [ -f "${MODULES_DIR}/swap.sh" ] && source "${MODULES_DIR}/swap.sh"
[ -f "${MODULES_DIR}/desktop_display.sh" ] && source "${MODULES_DIR}/desktop_display.sh" [ -f "${MODULES_DIR}/desktop_display.sh" ] && source "${MODULES_DIR}/desktop_display.sh"
[ -f "${MODULES_DIR}/system/system_prefs.sh" ] && source "${MODULES_DIR}/system/system_prefs.sh" [ -f "${MODULES_DIR}/system/system_prefs.sh" ] && source "${MODULES_DIR}/system/system_prefs.sh"
[ -f "${MODULES_DIR}/system/audio.sh" ] && source "${MODULES_DIR}/system/audio.sh" [ -f "${MODULES_DIR}/system/audio.sh" ] && source "${MODULES_DIR}/system/audio.sh"
@@ -38,19 +38,18 @@ source "${MODULES_DIR}/repos.sh"
# ── Bullseye-specific modules (loaded only on Debian 11) ── # ── Bullseye-specific modules (loaded only on Debian 11) ──
if [ -d "${MODULES_DIR}/bullseye" ]; then if [ -d "${MODULES_DIR}/bullseye" ]; then
[ -f "${MODULES_DIR}/bullseye/legacy.sh" ] && source "${MODULES_DIR}/bullseye/legacy.sh" [ -f "${MODULES_DIR}/bullseye/legacy.sh" ] && source "${MODULES_DIR}/bullseye/legacy.sh"
[ -f "${MODULES_DIR}/bullseye/repos.sh" ] && source "${MODULES_DIR}/bullseye/repos.sh" [ -f "${MODULES_DIR}/bullseye/repos.sh" ] && source "${MODULES_DIR}/bullseye/repos.sh"
[ -f "${MODULES_DIR}/bullseye/extras.sh" ] && source "${MODULES_DIR}/bullseye/extras.sh" [ -f "${MODULES_DIR}/bullseye/extras.sh" ] && source "${MODULES_DIR}/bullseye/extras.sh"
fi fi
REPOS_CONFIGURED=false
DEBIAN_VERSION="" DEBIAN_VERSION=""
DEBIAN_CODENAME="" DEBIAN_CODENAME=""
main_menu() { main_menu() {
# Auto-adjust TUI dimensions for small terminals # Auto-adjust TUI dimensions for small terminals
if [ "${LINES:-24}" -lt $((TUI_ALTO + 6)) ] || [ "${COLUMNS:-80}" -lt $((TUI_ANCHO + 6)) ]; then if [ "${LINES:-24}" -lt $((TUI_ALTO + 6)) ] || [ "${COLUMNS:-80}" -lt $((TUI_ANCHO + 6)) ]; then
TUI_ALTO=$(( ${LINES:-24} - 4 > 8 ? ${LINES:-24} - 4 : 8)) TUI_ALTO=$((${LINES:-24} - 4 > 8 ? ${LINES:-24} - 4 : 8))
TUI_ANCHO=$(( ${COLUMNS:-80} - 4 > 50 ? ${COLUMNS:-80} - 4 : 50)) TUI_ANCHO=$((${COLUMNS:-80} - 4 > 50 ? ${COLUMNS:-80} - 4 : 50))
TUI_ALTO_LISTA=$((TUI_ALTO - 10 > 4 ? TUI_ALTO - 10 : 4)) TUI_ALTO_LISTA=$((TUI_ALTO - 10 > 4 ? TUI_ALTO - 10 : 4))
fi fi
@@ -78,58 +77,81 @@ main_menu() {
clear clear
case "$choice" in case "$choice" in
1) _show_sysinfo ;; 1) _show_sysinfo ;;
2) config_sudo || true ;; 2) config_sudo || true ;;
3) _system_preferences_menu ;; 3)
4) _system_preferences_menu
if [ "$DEBIAN_VERSION" = "11" ] && type configure_repos_bullseye &>/dev/null; then STATE_REFRESHED=true
configure_repos_bullseye || true ;;
else 4)
configure_repos || true if [ "$DEBIAN_VERSION" = "11" ] && type configure_repos_bullseye &>/dev/null; then
fi configure_repos_bullseye || true
STATE_REFRESHED=true else
;; configure_repos || true
5) fi
if [ "$DEBIAN_VERSION" = "11" ] && type install_firmware_bullseye &>/dev/null; then STATE_REFRESHED=true
install_firmware_bullseye || true ;;
else 5)
install_firmware || true if [ "$DEBIAN_VERSION" = "11" ] && type install_firmware_bullseye &>/dev/null; then
fi install_firmware_bullseye || true
;; else
6) install_firmware || true
local gpu_sub fi
gpu_sub=$(_menu "Graphics Drivers" "" 12 50 2 \ STATE_REFRESHED=true
"1" "Radeon/Intel Mesa" \ ;;
"2" "NVIDIA Drivers") 6)
[ -z "$gpu_sub" ] && continue local gpu_sub
clear gpu_sub=$(_menu "Graphics Drivers" "" 12 50 2 \
case $gpu_sub in "1" "Radeon/Intel Mesa" \
1) _install_amd_intel_stack || true ;; "2" "NVIDIA Drivers")
2) _install_nvidia_stack || true ;; [ -z "$gpu_sub" ] && continue
esac clear
STATE_REFRESHED=true case $gpu_sub in
;; 1) _install_amd_intel_stack || true ;;
7) show_kernel_menu || true ;; 2) _install_nvidia_stack || true ;;
8) esac
if [ "$DEBIAN_VERSION" = "11" ] && type install_gaming_bullseye &>/dev/null; then STATE_REFRESHED=true
install_gaming_bullseye || true ;;
else 7)
install_gaming || true show_kernel_menu || true
fi STATE_REFRESHED=true
STATE_REFRESHED=true ;;
;; 8)
9) zram_menu || true ;; if [ "$DEBIAN_VERSION" = "11" ] && type install_gaming_bullseye &>/dev/null; then
10) manage_swap || true; STATE_REFRESHED=true ;; install_gaming_bullseye || true
11) else
if [ "$DEBIAN_VERSION" = "11" ] && type install_extras_bullseye &>/dev/null; then install_gaming || true
install_extras_bullseye || true fi
else STATE_REFRESHED=true
install_extras || true ;;
fi 9)
;; zram_menu || true
12) rescue_boot || true ;; STATE_REFRESHED=true
13) manage_desktop_display || true ;; ;;
14) echo "Exiting."; exit 0 ;; 10)
manage_swap || true
STATE_REFRESHED=true
;;
11)
if [ "$DEBIAN_VERSION" = "11" ] && type install_extras_bullseye &>/dev/null; then
install_extras_bullseye || true
else
install_extras || true
fi
STATE_REFRESHED=true
;;
12)
rescue_boot || true
STATE_REFRESHED=true
;;
13)
manage_desktop_display || true
STATE_REFRESHED=true
;;
14)
echo "Exiting."
exit 0
;;
esac esac
if $STATE_REFRESHED; then if $STATE_REFRESHED; then
refresh_system_state refresh_system_state
@@ -139,6 +161,10 @@ main_menu() {
check_root check_root
check_sudo check_sudo
if ! command -v whiptail >/dev/null 2>&1; then
echo -e "${YELLOW}[+] whiptail not found. Installing required TUI dependencies...${NC}"
_ensure_apt_updated && sudo apt-get install -y whiptail
fi
if ! _check_network; then if ! _check_network; then
echo -e "${YELLOW}──────────────────────────────────────────${NC}" echo -e "${YELLOW}──────────────────────────────────────────${NC}"
echo -e "${YELLOW} No internet connectivity detected.${NC}" echo -e "${YELLOW} No internet connectivity detected.${NC}"
@@ -152,6 +178,7 @@ _ensure_time_synced
detect_debian_version detect_debian_version
detect_cpu_ram detect_cpu_ram
detect_kernel detect_kernel
_init_lspci_cache
detect_gpu detect_gpu
detect_network detect_network
detect_displayserver detect_displayserver
+354 -324
View File
@@ -61,20 +61,21 @@ Instalar?"; then
_cat_customization_bullseye() { _cat_customization_bullseye() {
local sub local sub
sub=$(_menu "Customization (Bullseye)" "Select type:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ sub=$(
"1" "Desktop Themes (GTK/KDE)" \ _menu "Customization (Bullseye)" "Select type:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"2" "Icon Themes" \ "1" "Desktop Themes (GTK/KDE)" \
"3" "Cursor Themes" \ "2" "Icon Themes" \
"4" "Fonts" \ "3" "Cursor Themes" \
"5" "Terminals" \ "4" "Fonts" \
) "5" "Terminals"
)
[ -z "$sub" ] && return [ -z "$sub" ] && return
case $sub in case $sub in
1) _cat_themes_bullseye ;; 1) _cat_themes_bullseye ;;
2) _cat_icons_bullseye ;; 2) _cat_icons_bullseye ;;
3) _cat_cursors_bullseye ;; 3) _cat_cursors_bullseye ;;
4) _cat_fonts_bullseye ;; 4) _cat_fonts_bullseye ;;
5) _cat_terminals ;; 5) _cat_terminals ;;
esac esac
} }
@@ -82,17 +83,19 @@ _cat_themes_bullseye() {
local item_count=6 local item_count=6
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Desktop Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"arc-theme" "Arc GTK theme" "$(_state arc-theme)" \ _checklist "Desktop Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"blackbird-gtk-theme" "Blackbird GTK theme" "$(_state blackbird-gtk-theme)" \ "arc-theme" "Arc GTK theme" "$(_state arc-theme)" \
"bluebird-gtk-theme" "Bluebird GTK theme" "$(_state bluebird-gtk-theme)" \ "blackbird-gtk-theme" "Blackbird GTK theme" "$(_state blackbird-gtk-theme)" \
"breeze-gtk-theme" "Breeze GTK theme (KDE port)" "$(_state breeze-gtk-theme)" \ "bluebird-gtk-theme" "Bluebird GTK theme" "$(_state bluebird-gtk-theme)" \
"greybird-gtk-theme" "Greybird GTK theme" "$(_state greybird-gtk-theme)" \ "breeze-gtk-theme" "Breeze GTK theme (KDE port)" "$(_state breeze-gtk-theme)" \
"numix-gtk-theme" "Numix GTK theme" "$(_state numix-gtk-theme)" \ "greybird-gtk-theme" "Greybird GTK theme" "$(_state greybird-gtk-theme)" \
) "numix-gtk-theme" "Numix GTK theme" "$(_state numix-gtk-theme)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed." ! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
done done
@@ -101,24 +104,25 @@ _cat_themes_bullseye() {
_cat_icons_bullseye() { _cat_icons_bullseye() {
local items=( local items=(
"breeze-icon-theme" "Breeze icon theme" "$(_state breeze-icon-theme)" "breeze-icon-theme" "Breeze icon theme" "$(_state breeze-icon-theme)"
"deepin-icon-theme" "Deepin icon theme" "$(_state deepin-icon-theme)" "deepin-icon-theme" "Deepin icon theme" "$(_state deepin-icon-theme)"
"moka-icon-theme" "Moka icon theme" "$(_state moka-icon-theme)" "moka-icon-theme" "Moka icon theme" "$(_state moka-icon-theme)"
"numix-icon-theme" "Numix icon theme" "$(_state numix-icon-theme)" "numix-icon-theme" "Numix icon theme" "$(_state numix-icon-theme)"
"numix-icon-theme-circle" "Numix Circle icon theme" "$(_state numix-icon-theme-circle)" "numix-icon-theme-circle" "Numix Circle icon theme" "$(_state numix-icon-theme-circle)"
"obsidian-icon-theme" "Obsidian icon theme" "$(_state obsidian-icon-theme)" "obsidian-icon-theme" "Obsidian icon theme" "$(_state obsidian-icon-theme)"
"papirus-icon-theme" "Papirus icon theme" "$(_state papirus-icon-theme)" "papirus-icon-theme" "Papirus icon theme" "$(_state papirus-icon-theme)"
"paper-icon-theme" "Paper icon theme" "$(_state paper-icon-theme)" "paper-icon-theme" "Paper icon theme" "$(_state paper-icon-theme)"
"suru-icon-theme" "Suru icon theme" "$(_state suru-icon-theme)" "suru-icon-theme" "Suru icon theme" "$(_state suru-icon-theme)"
) )
local item_count=${#items[@]} local item_count=${#items[@]}
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Icon Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(_checklist "Icon Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"${items[@]}" ) "${items[@]}")
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed." ! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
done done
@@ -129,16 +133,18 @@ _cat_cursors_bullseye() {
local item_count=5 local item_count=5
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Cursor Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"breeze-cursor-theme" "Breeze cursors (KDE)" "$(_state breeze-cursor-theme)" \ _checklist "Cursor Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"chameleon-cursor-theme" "Chameleon cursors" "$(_state chameleon-cursor-theme)" \ "breeze-cursor-theme" "Breeze cursors (KDE)" "$(_state breeze-cursor-theme)" \
"dmz-cursor-theme" "DMZ cursors" "$(_state dmz-cursor-theme)" \ "chameleon-cursor-theme" "Chameleon cursors" "$(_state chameleon-cursor-theme)" \
"oxygencursors" "Oxygen cursors (KDE legacy)" "$(_state oxygencursors)" \ "dmz-cursor-theme" "DMZ cursors" "$(_state dmz-cursor-theme)" \
"xcursor-themes" "X11 base cursors" "$(_state xcursor-themes)" \ "oxygencursors" "Oxygen cursors (KDE legacy)" "$(_state oxygencursors)" \
) "xcursor-themes" "X11 base cursors" "$(_state xcursor-themes)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed." ! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
done done
@@ -149,15 +155,17 @@ _cat_fonts_bullseye() {
local item_count=4 local item_count=4
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Fonts (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"fonts-firacode" "Fira Code monospace font" "$(_state fonts-firacode)" \ _checklist "Fonts (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"fonts-noto" "Noto fonts (Google)" "$(_state fonts-noto)" \ "fonts-firacode" "Fira Code monospace font" "$(_state fonts-firacode)" \
"fonts-dejavu-core" "DejaVu core fonts" "$(_state fonts-dejavu-core)" \ "fonts-noto" "Noto fonts (Google)" "$(_state fonts-noto)" \
"ttf-mscorefonts-installer" "Microsoft Core Fonts" "$(_state ttf-mscorefonts-installer)" \ "fonts-dejavu-core" "DejaVu core fonts" "$(_state fonts-dejavu-core)" \
) "ttf-mscorefonts-installer" "Microsoft Core Fonts" "$(_state ttf-mscorefonts-installer)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed." ! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
done done
@@ -169,29 +177,34 @@ _cat_download_bullseye() {
local item_count1=2 local item_count1=2
local lista_alto1=$((item_count1 > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count1)) local lista_alto1=$((item_count1 > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count1))
choices1=$(_checklist "Downloaders" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto1 \ choices1=$(
"aria2" "Multiprotocol downloader (CLI)" "$(_state aria2)" \ _checklist "Downloaders" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto1 \
"filezilla" "FTP/SFTP client (GUI)" "$(_state filezilla)" \ "aria2" "Multiprotocol downloader (CLI)" "$(_state aria2)" \
) "filezilla" "FTP/SFTP client (GUI)" "$(_state filezilla)"
)
clear clear
local item_count2=8 local item_count2=8
local lista_alto2=$((item_count2 > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count2)) local lista_alto2=$((item_count2 > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count2))
choices2=$(_checklist "Torrent Clients" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto2 \ choices2=$(
"deluge" "BitTorrent client (GTK)" "$(_state deluge)" \ _checklist "Torrent Clients" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto2 \
"deluged" "BitTorrent daemon/server" "$(_state deluged)" \ "deluge" "BitTorrent client (GTK)" "$(_state deluge)" \
"mktorrent" "Torrent metainfo creator (CLI)" "$(_state mktorrent)" \ "deluged" "BitTorrent daemon/server" "$(_state deluged)" \
"qbittorrent" "BitTorrent client (Qt)" "$(_state qbittorrent)" \ "mktorrent" "Torrent metainfo creator (CLI)" "$(_state mktorrent)" \
"qbittorrent-nox" "BitTorrent WebUI/CLI" "$(_state qbittorrent-nox)" \ "qbittorrent" "BitTorrent client (Qt)" "$(_state qbittorrent)" \
"transmission-cli" "BitTorrent client (CLI)" "$(_state transmission-cli)" \ "qbittorrent-nox" "BitTorrent WebUI/CLI" "$(_state qbittorrent-nox)" \
"transmission-gtk" "BitTorrent client (GTK)" "$(_state transmission-gtk)" \ "transmission-cli" "BitTorrent client (CLI)" "$(_state transmission-cli)" \
"transmission-qt" "BitTorrent client (Qt)" "$(_state transmission-qt)" \ "transmission-gtk" "BitTorrent client (GTK)" "$(_state transmission-gtk)" \
) "transmission-qt" "BitTorrent client (Qt)" "$(_state transmission-qt)"
)
clear clear
local cleaned local cleaned
cleaned=$(echo "$choices1 $choices2" | tr -d '"') cleaned=$(echo "$choices1 $choices2" | tr -d '"')
[ -z "$cleaned" ] && { echo "No download tools selected."; return; } [ -z "$cleaned" ] && {
echo "No download tools selected."
return
}
for pkg in $cleaned; do for pkg in $cleaned; do
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
@@ -207,39 +220,41 @@ _cat_internet_bullseye() {
local item_count=11 local item_count=11
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Internet (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"chromium" "Chromium web browser" "$(_state chromium)" \ _checklist "Internet (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"dillo" "Lightweight graphical browser" "$(_state dillo)" \ "chromium" "Chromium web browser" "$(_state chromium)" \
"elinks" "Text-mode web browser" "$(_state elinks)" \ "dillo" "Lightweight graphical browser" "$(_state dillo)" \
"epiphany-browser" "GNOME web browser" "$(_state epiphany-browser)" \ "elinks" "Text-mode web browser" "$(_state elinks)" \
"falkon" "KDE web browser (QtWebEngine)" "$(_state falkon)" \ "epiphany-browser" "GNOME web browser" "$(_state epiphany-browser)" \
"firefox-esr" "Firefox ESR (official Debian)" "$(_state firefox-esr)" \ "falkon" "KDE web browser (QtWebEngine)" "$(_state falkon)" \
"konqueror" "KDE file manager / web browser" "$(_state konqueror)" \ "firefox-esr" "Firefox ESR (official Debian)" "$(_state firefox-esr)" \
"qutebrowser" "Keyboard-driven browser (Qt)" "$(_state qutebrowser)" \ "konqueror" "KDE file manager / web browser" "$(_state konqueror)" \
"thunderbird" "Email client" "$(_state thunderbird)" \ "qutebrowser" "Keyboard-driven browser (Qt)" "$(_state qutebrowser)" \
"torbrowser-launcher" "Tor Browser launcher" "$(_state torbrowser-launcher)" \ "thunderbird" "Email client" "$(_state thunderbird)" \
"w3m" "Text-mode browser + deps" "$(_state w3m)" \ "torbrowser-launcher" "Tor Browser launcher" "$(_state torbrowser-launcher)" \
) "w3m" "Text-mode browser + deps" "$(_state w3m)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
w3m) w3m)
local need=() local need=()
! is_installed "w3m" && need+=("w3m") ! is_installed "w3m" && need+=("w3m")
! is_installed "w3m-img" && need+=("w3m-img") ! is_installed "w3m-img" && need+=("w3m-img")
! is_installed "ca-certificates" && need+=("ca-certificates") ! is_installed "ca-certificates" && need+=("ca-certificates")
! is_installed "xsel" && need+=("xsel") ! is_installed "xsel" && need+=("xsel")
[ ${#need[@]} -gt 0 ] && _run_install_batch "${need[@]}" || echo "Already installed." [ ${#need[@]} -gt 0 ] && _run_install_batch "${need[@]}" || echo "Already installed."
;; ;;
*) *)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
;; ;;
esac esac
done done
echo -e "${GREEN}Internet tools installed.${NC}" echo -e "${GREEN}Internet tools installed.${NC}"
@@ -249,13 +264,15 @@ _cat_players_bullseye() {
local item_count=2 local item_count=2
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Media Players (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"mpv" "Lightweight media player" "$(_state mpv)" \ _checklist "Media Players (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"vlc" "VLC media player" "$(_state vlc)" \ "mpv" "Lightweight media player" "$(_state mpv)" \
) "vlc" "VLC media player" "$(_state vlc)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
@@ -270,24 +287,26 @@ _cat_design_bullseye() {
local item_count=13 local item_count=13
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Multimedia & Design (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"ardour" "Digital audio workstation" "$(_state ardour)" \ _checklist "Multimedia & Design (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"audacity" "Audio editor/recorder" "$(_state audacity)" \ "ardour" "Digital audio workstation" "$(_state ardour)" \
"blender" "3D modeling/animation suite" "$(_state blender)" \ "audacity" "Audio editor/recorder" "$(_state audacity)" \
"ffmpeg" "Multimedia framework (CLI)" "$(_state ffmpeg)" \ "blender" "3D modeling/animation suite" "$(_state blender)" \
"gimp" "Image editor" "$(_state gimp)" \ "ffmpeg" "Multimedia framework (CLI)" "$(_state ffmpeg)" \
"handbrake" "Video transcoder (DVD ripper)" "$(_state handbrake)" \ "gimp" "Image editor" "$(_state gimp)" \
"inkscape" "Vector graphics editor" "$(_state inkscape)" \ "handbrake" "Video transcoder (DVD ripper)" "$(_state handbrake)" \
"kdenlive" "Video editor (KDE)" "$(_state kdenlive)" \ "inkscape" "Vector graphics editor" "$(_state inkscape)" \
"krita" "Digital painting/illustration" "$(_state krita)" \ "kdenlive" "Video editor (KDE)" "$(_state kdenlive)" \
"obs-studio" "Screen recording/streaming" "$(_state obs-studio)" \ "krita" "Digital painting/illustration" "$(_state krita)" \
"openshot-qt" "Video editor (simple)" "$(_state openshot-qt)" \ "obs-studio" "Screen recording/streaming" "$(_state obs-studio)" \
"scribus" "Desktop publishing (DTP)" "$(_state scribus)" \ "openshot-qt" "Video editor (simple)" "$(_state openshot-qt)" \
"shotcut" "Video editor (cross-platform)" "$(_state shotcut)" \ "scribus" "Desktop publishing (DTP)" "$(_state scribus)" \
) "shotcut" "Video editor (cross-platform)" "$(_state shotcut)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
@@ -302,20 +321,22 @@ _cat_programming_bullseye() {
local item_count=9 local item_count=9
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Code Editors & IDEs (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"vim" "Classic terminal editor" "$(_state vim)" \ _checklist "Code Editors & IDEs (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"vim-gtk3" "Vim with GTK3 GUI" "$(_state vim-gtk3)" \ "vim" "Classic terminal editor" "$(_state vim)" \
"neovim" "Modern vim fork" "$(_state neovim)" \ "vim-gtk3" "Vim with GTK3 GUI" "$(_state vim-gtk3)" \
"nano" "Simple terminal editor" "$(_state nano)" \ "neovim" "Modern vim fork" "$(_state neovim)" \
"emacs" "Extensible editor / IDE" "$(_state emacs)" \ "nano" "Simple terminal editor" "$(_state nano)" \
"kate" "KDE advanced text editor" "$(_state kate)" \ "emacs" "Extensible editor / IDE" "$(_state emacs)" \
"mousepad" "Xfce text editor" "$(_state mousepad)" \ "kate" "KDE advanced text editor" "$(_state kate)" \
"gedit" "GNOME text editor" "$(_state gedit)" \ "mousepad" "Xfce text editor" "$(_state mousepad)" \
"geany" "Lightweight IDE" "$(_state geany)" \ "gedit" "GNOME text editor" "$(_state gedit)" \
) "geany" "Lightweight IDE" "$(_state geany)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
@@ -330,62 +351,64 @@ _cat_dev_bullseye() {
local item_count=14 local item_count=14
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Servers & Dev Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"apache2" "Apache web server" "$(_state apache2)" \ _checklist "Servers & Dev Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"build-essential" "C/C++ build tools (gcc, make)" "$(_state build-essential)" \ "apache2" "Apache web server" "$(_state apache2)" \
"docker" "Docker container runtime" "$(_state docker.io)" \ "build-essential" "C/C++ build tools (gcc, make)" "$(_state build-essential)" \
"mariadb-server" "MariaDB database server" "$(_state mariadb-server)" \ "docker" "Docker container runtime" "$(_state docker.io)" \
"netcat-openbsd" "TCP/IP networking utility" "$(_state netcat-openbsd)" \ "mariadb-server" "MariaDB database server" "$(_state mariadb-server)" \
"nginx" "Nginx web server" "$(_state nginx)" \ "netcat-openbsd" "TCP/IP networking utility" "$(_state netcat-openbsd)" \
"openssh-server" "SSH server" "$(_state openssh-server)" \ "nginx" "Nginx web server" "$(_state nginx)" \
"openssl" "OpenSSL cryptography toolkit" "$(_state openssl)" \ "openssh-server" "SSH server" "$(_state openssh-server)" \
"postgresql" "PostgreSQL database server" "$(_state postgresql)" \ "openssl" "OpenSSL cryptography toolkit" "$(_state openssl)" \
"python3-pip" "Python 3 pip + venv + dev" "$(_state python3-pip)" \ "postgresql" "PostgreSQL database server" "$(_state postgresql)" \
"redis-server" "Redis key-value store" "$(_state redis-server)" \ "python3-pip" "Python 3 pip + venv + dev" "$(_state python3-pip)" \
"sqlite3" "SQLite database engine" "$(_state sqlite3)" \ "redis-server" "Redis key-value store" "$(_state redis-server)" \
"jellyfin" "Jellyfin Media Server (Web GUI on port 8096)" OFF \ "sqlite3" "SQLite database engine" "$(_state sqlite3)" \
"openjdk-dev-env" "Adoptium Temurin JDK (17, 21, 25 LTS)$(_any_jdk_installed_desc)" "$(_any_jdk_state)" \ "jellyfin" "Jellyfin Media Server (Web GUI on port 8096)" OFF \
) "openjdk-dev-env" "Adoptium Temurin JDK (17, 21, 25 LTS)$(_any_jdk_installed_desc)" "$(_any_jdk_state)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
docker) docker)
local need=() local need=()
! is_installed "docker.io" && need+=("docker.io") ! is_installed "docker.io" && need+=("docker.io")
! is_installed "docker-compose" && need+=("docker-compose") ! is_installed "docker-compose" && need+=("docker-compose")
if [ ${#need[@]} -gt 0 ]; then if [ ${#need[@]} -gt 0 ]; then
_run_install_batch "${need[@]}" _run_install_batch "${need[@]}"
else else
echo "Docker already installed." echo "Docker already installed."
fi fi
;; ;;
python3-pip) python3-pip)
local need=() local need=()
! is_installed "python3-pip" && need+=("python3-pip") ! is_installed "python3-pip" && need+=("python3-pip")
! is_installed "python3-venv" && need+=("python3-venv") ! is_installed "python3-venv" && need+=("python3-venv")
! is_installed "python3-dev" && need+=("python3-dev") ! is_installed "python3-dev" && need+=("python3-dev")
if [ ${#need[@]} -gt 0 ]; then if [ ${#need[@]} -gt 0 ]; then
_run_install_batch "${need[@]}" _run_install_batch "${need[@]}"
else else
echo "Python 3 tools already installed." echo "Python 3 tools already installed."
fi fi
;; ;;
jellyfin) jellyfin)
install_jellyfin install_jellyfin
;; ;;
openjdk-dev-env) openjdk-dev-env)
_install_dev_java _install_dev_java
;; ;;
*) *)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
;; ;;
esac esac
done done
echo -e "${GREEN}Servers & dev tools installed.${NC}" echo -e "${GREEN}Servers & dev tools installed.${NC}"
@@ -394,28 +417,30 @@ _cat_security_bullseye() {
local item_count=5 local item_count=5
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Security & Networking (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"wireshark" "Network protocol analyzer (GUI)" "$(_state wireshark)" \ _checklist "Security & Networking (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"tcpdump" "Command-line packet analyzer" "$(_state tcpdump)" \ "wireshark" "Network protocol analyzer (GUI)" "$(_state wireshark)" \
"fail2ban" "Brute-force protection daemon" "$(_state fail2ban)" \ "tcpdump" "Command-line packet analyzer" "$(_state tcpdump)" \
"ufw" "Uncomplicated firewall" "$(_state ufw)" \ "fail2ban" "Brute-force protection daemon" "$(_state fail2ban)" \
"clamav" "Antivirus engine (ClamAV)" "$(_state clamav)" \ "ufw" "Uncomplicated firewall" "$(_state ufw)" \
) "clamav" "Antivirus engine (ClamAV)" "$(_state clamav)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
clamav) clamav)
_install_clamav _install_clamav
;; ;;
*) *)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
;; ;;
esac esac
done done
echo -e "${GREEN}Security & networking tools installed.${NC}" echo -e "${GREEN}Security & networking tools installed.${NC}"
@@ -425,104 +450,106 @@ _cat_general_bullseye() {
local item_count=22 local item_count=22
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "System Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"compress" "Compression tools (zip, unrar, p7zip)" "$(_state zip)" \ _checklist "System Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
"conky" "System monitor for desktop" "$(_state conky)" \ "compress" "Compression tools (zip, unrar, p7zip)" "$(_state zip)" \
"cpu-x" "CPU-X (alternative to CPU-Z)" "$(_state cpu-x)" \ "conky-all" "System monitor for desktop" "$(_state conky-all)" \
"curl-wget" "HTTP transfer tools (curl, wget)" "$(_state curl)" \ "cpu-x" "CPU-X (alternative to CPU-Z)" "$(_state cpu-x)" \
"flatpak" "Flatpak sandbox (Bullseye native)" "$(_state flatpak)" \ "curl-wget" "HTTP transfer tools (curl, wget)" "$(_state curl)" \
"fwupd" "Firmware update daemon" "$(_state fwupd)" \ "flatpak" "Flatpak sandbox (Bullseye native)" "$(_state flatpak)" \
"gnome-disk-utility" "Disk management GUI" "$(_state gnome-disk-utility)" \ "fwupd" "Firmware update daemon" "$(_state fwupd)" \
"gparted" "Partition editor" "$(_state gparted)" \ "gnome-disk-utility" "Disk management GUI" "$(_state gnome-disk-utility)" \
"htop" "Interactive process viewer" "$(_state htop)" \ "gparted" "Partition editor" "$(_state gparted)" \
"inxi" "System information tool" "$(_state inxi)" \ "htop" "Interactive process viewer" "$(_state htop)" \
"jq" "JSON command-line processor" "$(_state jq)" \ "inxi" "System information tool" "$(_state inxi)" \
"kvm" "QEMU/KVM virtualization" "$(_state virt-manager)" \ "jq" "JSON command-line processor" "$(_state jq)" \
"lshw" "List hardware details" "$(_state lshw)" \ "kvm" "QEMU/KVM virtualization" "$(_state virt-manager)" \
"mc" "Midnight Commander" "$(_state mc)" \ "lshw" "List hardware details" "$(_state lshw)" \
"nvme-cli" "NVMe SSD health monitoring" "$(_state nvme-cli)" \ "mc" "Midnight Commander" "$(_state mc)" \
"ncdu" "Disk usage analyzer" "$(_state ncdu)" \ "nvme-cli" "NVMe SSD health monitoring" "$(_state nvme-cli)" \
"psensor" "Temperature monitor" "$(_state psensor)" \ "ncdu" "Disk usage analyzer" "$(_state ncdu)" \
"timeshift" "System restore snapshots" "$(_state timeshift)" \ "psensor" "Temperature monitor" "$(_state psensor)" \
"tmux" "Terminal multiplexer" "$(_state tmux)" \ "timeshift" "System restore snapshots" "$(_state timeshift)" \
"wine" "Windows compatibility layer" "$(_state wine)" \ "tmux" "Terminal multiplexer" "$(_state tmux)" \
"bleachbit" "System cleaner (GUI)" "$(_state bleachbit)" \ "wine" "Windows compatibility layer" "$(_state wine)" \
"gdebi" "Install .deb packages with deps (GUI)" "$(_state gdebi)" \ "bleachbit" "System cleaner (GUI)" "$(_state bleachbit)" \
) "gdebi" "Install .deb packages with deps (GUI)" "$(_state gdebi)"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
compress) compress)
local need=() local need=()
! is_installed "zip" && need+=("zip") ! is_installed "zip" && need+=("zip")
! is_installed "unzip" && need+=("unzip") ! is_installed "unzip" && need+=("unzip")
! is_installed "rar" && need+=("rar") ! is_installed "rar" && need+=("rar")
! is_installed "unrar" && need+=("unrar") ! is_installed "unrar" && need+=("unrar")
! is_installed "p7zip-full" && need+=("p7zip-full") ! is_installed "p7zip-full" && need+=("p7zip-full")
! is_installed "p7zip-rar" && need+=("p7zip-rar") ! is_installed "p7zip-rar" && need+=("p7zip-rar")
[ ${#need[@]} -gt 0 ] && _run_install_batch "${need[@]}" [ ${#need[@]} -gt 0 ] && _run_install_batch "${need[@]}"
;; ;;
curl-wget) curl-wget)
local need=() local need=()
! is_installed "curl" && need+=("curl") ! is_installed "curl" && need+=("curl")
! is_installed "wget" && need+=("wget") ! is_installed "wget" && need+=("wget")
[ ${#need[@]} -gt 0 ] && _run_install_batch "${need[@]}" || echo "Already installed." [ ${#need[@]} -gt 0 ] && _run_install_batch "${need[@]}" || echo "Already installed."
;; ;;
kvm) kvm)
if ! is_installed "virt-manager"; then if ! is_installed "virt-manager"; then
_run_cmd "KVM" "sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager" "Installing KVM..." _run_cmd "KVM" "sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager" "Installing KVM..."
sudo adduser "$USER" libvirt 2>/dev/null || true sudo adduser "$USER" libvirt 2>/dev/null || true
sudo adduser "$USER" kvm 2>/dev/null || true sudo adduser "$USER" kvm 2>/dev/null || true
else
echo "QEMU/KVM already installed."
fi
;;
flatpak)
if ! is_installed "flatpak"; then
_run_cmd "Flatpak" "sudo apt install -y flatpak" "Installing Flatpak..."
flatpak remote-add --if-not-exists flathub \
https://dl.flathub.org/repo/flathub.flatpakrepo
echo -e "${GREEN}Flatpak + Flathub installed.${NC}"
else
echo "Flatpak already installed."
fi
;;
wine)
if ! is_installed "wine64"; then
_run_cmd "Wine" "sudo apt install -y --no-install-recommends wine64 fonts-wine" "Installing Wine (64-bit only)..."
local wine_ver
wine_ver=$(wine --version 2>/dev/null)
if [ -n "$wine_ver" ]; then
echo -e "${GREEN}Wine (64-bit) installed: ${wine_ver}${NC}"
else else
echo "QEMU/KVM already installed." echo -e "${YELLOW}Wine installed but version check failed.${NC}"
fi fi
;; else
flatpak) echo "Wine64 already installed."
if ! is_installed "flatpak"; then fi
_run_cmd "Flatpak" "sudo apt install -y flatpak" "Installing Flatpak..." ;;
flatpak remote-add --if-not-exists flathub \ fwupd)
https://dl.flathub.org/repo/flathub.flatpakrepo if ! is_installed "fwupd"; then
echo -e "${GREEN}Flatpak + Flathub installed.${NC}" _run_cmd "fwupd" "sudo apt install -y fwupd" "Installing fwupd..."
else fi
echo "Flatpak already installed." if _confirm "Firmware Scan" "Scan for firmware updates now?"; then
fi sudo fwupdmgr refresh --force 2>/dev/null || true
;; sudo fwupdmgr get-updates 2>&1 || true
wine) _pause
if ! is_installed "wine64"; then fi
_run_cmd "Wine" "sudo apt install -y --no-install-recommends wine64 fonts-wine" "Installing Wine (64-bit only)..." ;;
local wine_ver nvme-cli)
wine_ver=$(wine --version 2>/dev/null) _run_install "nvme-cli"
if [ -n "$wine_ver" ]; then ;;
echo -e "${GREEN}Wine (64-bit) installed: ${wine_ver}${NC}" *)
else if ! is_installed "$pkg"; then
echo -e "${YELLOW}Wine installed but version check failed.${NC}" _run_install "$pkg"
fi else
else echo "$pkg already installed."
echo "Wine64 already installed." fi
fi ;;
;;
fwupd)
if ! is_installed "fwupd"; then
_run_cmd "fwupd" "sudo apt install -y fwupd" "Installing fwupd..."
fi
if _confirm "Firmware Scan" "Scan for firmware updates now?"; then
sudo fwupdmgr refresh --force 2>/dev/null || true
sudo fwupdmgr get-updates 2>&1 || true
_pause
fi
;;
nvme-cli)
_run_install "nvme-cli"
;;
*)
if ! is_installed "$pkg"; then
_run_install "$pkg"
else
echo "$pkg already installed."
fi
;;
esac esac
done done
echo -e "${GREEN}System tools installed.${NC}" echo -e "${GREEN}System tools installed.${NC}"
@@ -531,18 +558,19 @@ _cat_general_bullseye() {
_cat_fetch_bullseye() { _cat_fetch_bullseye() {
local items=( local items=(
"neofetch" "System info fetcher" "$(_state neofetch)" "neofetch" "System info fetcher" "$(_state neofetch)"
"screenfetch" "System info (BSD/Linux)" "$(_state screenfetch)" "screenfetch" "System info (BSD/Linux)" "$(_state screenfetch)"
"linuxlogo" "Linux logo + system info" "$(_state linuxlogo)" "linuxlogo" "Linux logo + system info" "$(_state linuxlogo)"
) )
local item_count=${#items[@]} local item_count=${#items[@]}
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Fetch Tools (Bullseye)" "Select system info tools:" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(_checklist "Fetch Tools (Bullseye)" "Select system info tools:" $TUI_ALTO $TUI_ANCHO $lista_alto \
"${items[@]}" ) "${items[@]}")
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
@@ -562,41 +590,42 @@ install_extras_bullseye() {
while true; do while true; do
local cat_choice local cat_choice
cat_choice=$(_menu "Extra Software — Bullseye" "Select a category:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ cat_choice=$(
"0" "Essential Pack" \ _menu "Extra Software — Bullseye" "Select a category:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"1" "Customization System" \ "0" "Essential Pack" \
"2" "Download & Network" \ "1" "Customization System" \
"3" "Internet (Browsers, Email)" \ "2" "Download & Network" \
"4" "Communication" \ "3" "Internet (Browsers, Email)" \
"5" "Media Players" \ "4" "Communication" \
"6" "Multimedia & Design" \ "5" "Media Players" \
"7" "Code Editors & IDEs" \ "6" "Multimedia & Design" \
"8" "Servers & Dev Tools" \ "7" "Code Editors & IDEs" \
"9" "Security & Networking" \ "8" "Servers & Dev Tools" \
"10" "Software Centers" \ "9" "Security & Networking" \
"11" "System Tools" \ "10" "Software Centers" \
"12" "Fetch / System Info" \ "11" "System Tools" \
"13" "Back to main menu" \ "12" "Fetch / System Info" \
) "13" "Back to main menu"
)
[ -z "$cat_choice" ] && return [ -z "$cat_choice" ] && return
clear clear
case "$cat_choice" in case "$cat_choice" in
0) _quick_install_bullseye ;; 0) _quick_install_bullseye ;;
1) _cat_customization_bullseye ;; 1) _cat_customization_bullseye ;;
2) _cat_download_bullseye ;; 2) _cat_download_bullseye ;;
3) _cat_internet_bullseye ;; 3) _cat_internet_bullseye ;;
4) _cat_communication ;; 4) _cat_communication ;;
5) _cat_players_bullseye ;; 5) _cat_players_bullseye ;;
6) _cat_design_bullseye ;; 6) _cat_design_bullseye ;;
7) _cat_programming_bullseye ;; 7) _cat_programming_bullseye ;;
8) _cat_dev_bullseye ;; 8) _cat_dev_bullseye ;;
9) _cat_security_bullseye ;; 9) _cat_security_bullseye ;;
10) _cat_software_centers_bullseye ;; 10) _cat_software_centers_bullseye ;;
11) _cat_general_bullseye ;; 11) _cat_general_bullseye ;;
12) _cat_fetch_bullseye ;; 12) _cat_fetch_bullseye ;;
13) return ;; 13) return ;;
esac esac
clear clear
done done
@@ -604,11 +633,12 @@ install_extras_bullseye() {
_cat_software_centers_bullseye() { _cat_software_centers_bullseye() {
local sc_choice local sc_choice
sc_choice=$(_menu "Software Centers" "Choose a software store to install:" 12 65 3 \ sc_choice=$(
"gnome-software" "Software Center for GNOME" \ _menu "Software Centers" "Choose a software store to install:" 12 65 3 \
"plasma-discover" "Software manager for Plasma" \ "gnome-software" "Software Center for GNOME" \
"synaptic" "Classic APT package manager (GTK)" \ "plasma-discover" "Software manager for Plasma" \
) "synaptic" "Classic APT package manager (GTK)"
)
[ -z "$sc_choice" ] && return [ -z "$sc_choice" ] && return
if [ "$sc_choice" = "synaptic" ]; then if [ "$sc_choice" = "synaptic" ]; then
+24 -23
View File
@@ -14,8 +14,8 @@ check_bullseye_archive_phase() {
current_year=$(date +%Y) current_year=$(date +%Y)
current_month=$(date +%-m) current_month=$(date +%-m)
if [ "$current_year" -gt 2026 ] || \ if [ "$current_year" -gt 2026 ] ||
{ [ "$current_year" -eq 2026 ] && [ "$current_month" -ge 9 ]; }; then { [ "$current_year" -eq 2026 ] && [ "$current_month" -ge 9 ]; }; then
BULLSEYE_USE_ARCHIVE=true BULLSEYE_USE_ARCHIVE=true
fi fi
@@ -33,7 +33,8 @@ No security updates will be available." 12 60
install_nvidia_bullseye() { install_nvidia_bullseye() {
echo -e "${YELLOW}NVIDIA GPU detected (Bullseye mode).${NC}" echo -e "${YELLOW}NVIDIA GPU detected (Bullseye mode).${NC}"
local is_fermi; is_fermi=$(is_nvidia_fermi) local is_fermi
is_fermi=$(is_nvidia_fermi)
local nv_pkg="" local nv_pkg=""
local gpu_gen="" local gpu_gen=""
@@ -108,13 +109,13 @@ install_gaming_bullseye() {
local choices local choices
choices=$(_checklist "Gaming Setup — Bullseye" \ choices=$(_checklist "Gaming Setup — Bullseye" \
"Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"i386" "Enable 32-bit (i386) architecture" ON \ "i386" "Enable 32-bit (i386) architecture" ON \
"steam" "Steam (requires 32-bit support)" ON \ "steam" "Steam (requires 32-bit support)" ON \
"mangohud" "Performance overlay (Vulkan/OpenGL)" ON \ "mangohud" "Performance overlay (Vulkan/OpenGL)" ON \
"gamemode" "Game performance optimization" OFF \ "gamemode" "Game performance optimization" OFF \
"goverlay" "MangoHud config GUI" ON \ "goverlay" "MangoHud config GUI" ON \
"java" "Minecraft Java Runtime" OFF \ "java" "Minecraft Java Runtime" OFF \
"lutris" "Lutris + Wine (requires 32-bit support)" OFF \ "lutris" "Lutris + Wine (requires 32-bit support)" OFF \
"retroarch" "RetroArch Emulator Frontend" OFF) "retroarch" "RetroArch Emulator Frontend" OFF)
if [ -z "$choices" ]; then if [ -z "$choices" ]; then
@@ -128,7 +129,7 @@ install_gaming_bullseye() {
local need_32bit=false local need_32bit=false
for p in $cleaned; do for p in $cleaned; do
case $p in steam|lutris) need_32bit=true ;; esac case $p in steam | lutris) need_32bit=true ;; esac
done done
echo "$cleaned" | grep -qw i386 && need_32bit=true echo "$cleaned" | grep -qw i386 && need_32bit=true
@@ -139,7 +140,7 @@ install_gaming_bullseye() {
if $need_32bit && ! dpkg --print-foreign-architectures 2>/dev/null | grep -q i386; then if $need_32bit && ! dpkg --print-foreign-architectures 2>/dev/null | grep -q i386; then
echo -e "${YELLOW}Enabling i386 architecture...${NC}" echo -e "${YELLOW}Enabling i386 architecture...${NC}"
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
fi fi
if $need_32bit; then if $need_32bit; then
@@ -153,20 +154,20 @@ install_gaming_bullseye() {
for pkg in $install_list; do for pkg in $install_list; do
case $pkg in case $pkg in
steam) steam)
if ensure_contrib_repo; then if ensure_contrib_repo; then
install_steam install_steam
else else
echo -e "${YELLOW}Skipping Steam installation (contrib repository not enabled).${NC}" echo -e "${YELLOW}Skipping Steam installation (contrib repository not enabled).${NC}"
fi fi
;; ;;
java) install_minecraft_java ;; java) install_minecraft_java ;;
mangohud) install_mangohud ;; mangohud) install_mangohud ;;
gamemode) install_gamemode ;; gamemode) install_gamemode ;;
goverlay) install_goverlay ;; goverlay) install_goverlay ;;
lutris) install_lutris ;; lutris) install_lutris ;;
retroarch) install_retroarch ;; retroarch) install_retroarch ;;
*) _run_install "$pkg" ;; *) _run_install "$pkg" ;;
esac esac
done done
+166 -166
View File
@@ -11,9 +11,9 @@ manage_desktop_display() {
[ -z "$choice" ] && break [ -z "$choice" ] && break
clear clear
case "$choice" in case "$choice" in
1) desktop_environment_menu ;; 1) desktop_environment_menu ;;
2) display_manager_menu ;; 2) display_manager_menu ;;
3) break ;; 3) break ;;
esac esac
done done
} }
@@ -33,9 +33,9 @@ desktop_environment_menu() {
[ -z "$choice" ] && break [ -z "$choice" ] && break
clear clear
case "$choice" in case "$choice" in
1) xfce_menu ;; 1) xfce_menu ;;
2) lxde_menu ;; 2) lxde_menu ;;
3) break ;; 3) break ;;
esac esac
done done
} }
@@ -49,8 +49,8 @@ lxde_menu() {
[ -z "$choice" ] && return 0 [ -z "$choice" ] && return 0
clear clear
case "$(echo "$choice" | tr -d '"')" in case "$(echo "$choice" | tr -d '"')" in
1) _install_lxde_full ;; 1) _install_lxde_full ;;
2) _install_lxde_core ;; 2) _install_lxde_core ;;
esac esac
} }
@@ -87,11 +87,11 @@ xfce_menu() {
[ -z "$choice" ] && break [ -z "$choice" ] && break
clear clear
case "$choice" in case "$choice" in
1) _install_xfce_full ;; 1) _install_xfce_full ;;
2) _install_xfce_minimal ;; 2) _install_xfce_minimal ;;
3) _install_xfce_wayland ;; 3) _install_xfce_wayland ;;
4) _install_xfce_custom ;; 4) _install_xfce_custom ;;
5) break ;; 5) break ;;
esac esac
done done
} }
@@ -188,26 +188,26 @@ display_manager_menu() {
[ -z "$choice" ] && break [ -z "$choice" ] && break
clear clear
case "$choice" in case "$choice" in
1) lightdm_config_menu ;; 1) lightdm_config_menu ;;
2) configure_gdm3 ;; 2) configure_gdm3 ;;
3) configure_sddm ;; 3) configure_sddm ;;
4) 4)
if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then
configure_greetd configure_greetd
else else
break break
fi fi
;; ;;
5) break ;; 5) break ;;
esac esac
done done
} }
lightdm_config_menu() { lightdm_config_menu() {
local -a items=() local -a items=()
items+=("install_lightdm" "Install LightDM & GTK Greeter" "$(_state lightdm)") items+=("install_lightdm" "Install LightDM & GTK Greeter" "$(_state lightdm)")
items+=("enable_userlist" "Enable user list at login screen" "OFF") items+=("enable_userlist" "Enable user list at login screen" "OFF")
items+=("enable_autologin" "Enable autologin for current user" "OFF") items+=("enable_autologin" "Enable autologin for current user" "OFF")
local choices local choices
choices=$(_checklist "LightDM Configuration" \ choices=$(_checklist "LightDM Configuration" \
"Select options to apply:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "Select options to apply:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
@@ -221,34 +221,34 @@ lightdm_config_menu() {
cleaned=$(echo "$choices" | tr -d '"') cleaned=$(echo "$choices" | tr -d '"')
for item in $cleaned; do for item in $cleaned; do
case $item in case $item in
install_lightdm) install_lightdm)
if ! is_installed lightdm || ! is_installed lightdm-gtk-greeter-settings; then if ! is_installed lightdm || ! is_installed lightdm-gtk-greeter-settings; then
echo "lightdm shared/default-x-display-manager select lightdm" | sudo debconf-set-selections echo "lightdm shared/default-x-display-manager select lightdm" | sudo debconf-set-selections
_run_cmd "LightDM" "sudo apt install -y lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings" "Installing LightDM & GTK Greeter..." _run_cmd "LightDM" "sudo apt install -y lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings" "Installing LightDM & GTK Greeter..."
else else
echo -e "${GREEN}[LightDM] LightDM and GTK Greeter settings are already installed, skipping...${NC}" echo -e "${GREEN}[LightDM] LightDM and GTK Greeter settings are already installed, skipping...${NC}"
fi fi
;; ;;
enable_userlist) enable_userlist)
local conf="/etc/lightdm/lightdm.conf.d/50-debianito-userlist.conf" local conf="/etc/lightdm/lightdm.conf.d/50-debianito-userlist.conf"
sudo mkdir -p "$(dirname "$conf")" sudo mkdir -p "$(dirname "$conf")"
if echo "[Seat:*] if echo "[Seat:*]
greeter-hide-users=false" | sudo tee "$conf" > /dev/null; then greeter-hide-users=false" | sudo tee "$conf" >/dev/null; then
echo -e "${GREEN}User list enabled in LightDM.${NC}" echo -e "${GREEN}User list enabled in LightDM.${NC}"
else else
echo -e "${RED}Failed to write configuration.${NC}" echo -e "${RED}Failed to write configuration.${NC}"
fi fi
;; ;;
enable_autologin) enable_autologin)
local dm_conf="/etc/lightdm/lightdm.conf" local dm_conf="/etc/lightdm/lightdm.conf"
local lightdm_user="${SUDO_USER:-$USER}" local lightdm_user="${SUDO_USER:-$USER}"
sudo sed -i 's/^#[[:space:]]*autologin-user[[:space:]=].*/autologin-user='"$lightdm_user"'/' "$dm_conf" sudo sed -i 's/^#[[:space:]]*autologin-user[[:space:]=].*/autologin-user='"$lightdm_user"'/' "$dm_conf"
sudo sed -i 's/^#[[:space:]]*autologin-user-timeout[[:space:]=].*/autologin-user-timeout=0/' "$dm_conf" sudo sed -i 's/^#[[:space:]]*autologin-user-timeout[[:space:]=].*/autologin-user-timeout=0/' "$dm_conf"
echo -e "${GREEN}Autologin enabled for user: ${lightdm_user}${NC}" echo -e "${GREEN}Autologin enabled for user: ${lightdm_user}${NC}"
;; ;;
esac esac
done done
_pause _pause
} }
configure_greetd() { configure_greetd() {
@@ -272,47 +272,47 @@ configure_greetd() {
[ -z "$choice" ] && return [ -z "$choice" ] && return
clear clear
case "$choice" in case "$choice" in
1) 1)
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
_run_cmd "greetd" "sudo apt install -y greetd" "Installing greetd..."
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
;;
2)
if [ "$DEBIAN_VERSION" = "12" ]; then
if [ "$(is_backports_enabled)" != true ]; then
_write_deb822_backports "bookworm"
_ensure_apt_updated
fi
_run_cmd "greetd" "sudo apt install -y -t bookworm-backports tuigreet greetd" "Installing greetd + tuigreet..."
else
_run_cmd "greetd" "sudo apt install -y greetd tuigreet" "Installing greetd + tuigreet..."
fi
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
;;
3)
if [ "$DEBIAN_VERSION" = "13" ]; then
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
_run_cmd "greetd" "sudo apt install -y greetd" "Installing greetd..." _run_cmd "greetd" "sudo apt install -y greetd gtkgreet" "Installing greetd + gtkgreet..."
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'." _msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
;; else
2) return
if [ "$DEBIAN_VERSION" = "12" ]; then fi
if [ "$(is_backports_enabled)" != true ]; then ;;
_write_deb822_backports "bookworm" 4)
sudo apt update -qq if [ "$DEBIAN_VERSION" = "13" ]; then
fi echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
_run_cmd "greetd" "sudo apt install -y -t bookworm-backports tuigreet greetd" "Installing greetd + tuigreet..." _run_cmd "greetd" "sudo apt install -y greetd nwg-hello" "Installing greetd + nwg-hello..."
else
_run_cmd "greetd" "sudo apt install -y greetd tuigreet" "Installing greetd + tuigreet..."
fi
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'." _msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
;; fi
3) ;;
if [ "$DEBIAN_VERSION" = "13" ]; then 5)
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections if [ "$DEBIAN_VERSION" = "13" ]; then
_run_cmd "greetd" "sudo apt install -y greetd gtkgreet" "Installing greetd + gtkgreet..." echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'." _run_cmd "greetd" "sudo apt install -y greetd wlgreet" "Installing greetd + wlgreet..."
else _msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
return fi
fi ;;
;; 6) return ;;
4)
if [ "$DEBIAN_VERSION" = "13" ]; then
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
_run_cmd "greetd" "sudo apt install -y greetd nwg-hello" "Installing greetd + nwg-hello..."
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
fi
;;
5)
if [ "$DEBIAN_VERSION" = "13" ]; then
echo "greetd shared/default-x-display-manager select greetd" | sudo debconf-set-selections
_run_cmd "greetd" "sudo apt install -y greetd wlgreet" "Installing greetd + wlgreet..."
_msg "greetd" "Warning: greetd was installed but NOT configured.\n\nYou must manually create /etc/greetd/config.toml\nto be able to log in.\n\nSee 'man greetd' and 'man 5 greetd-sessions'."
fi
;;
6) return ;;
esac esac
done done
} }
@@ -320,12 +320,12 @@ configure_greetd() {
configure_gdm3() { configure_gdm3() {
while true; do while true; do
local items_enabled=() local items_enabled=()
items_enabled+=("install" "Install/Reinstall gdm3 (Set as default)" "$(_state gdm3)") items_enabled+=("install" "Install/Reinstall gdm3 (Set as default)" "$(_state gdm3)")
items_enabled+=("userlist" "Hide user list (disable-user-list)" "OFF") items_enabled+=("userlist" "Hide user list (disable-user-list)" "OFF")
items_enabled+=("autologin" "Configure Autologin" "OFF") items_enabled+=("autologin" "Configure Autologin" "OFF")
if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then
if [ "$HAS_NVIDIA" = true ]; then if [ "$HAS_NVIDIA" = true ]; then
items_enabled+=("wayland" "Force Enable Wayland on NVIDIA (Risk!)" "OFF") items_enabled+=("wayland" "Force Enable Wayland on NVIDIA (Risk!)" "OFF")
fi fi
fi fi
local choice local choice
@@ -340,50 +340,50 @@ configure_gdm3() {
cleaned=$(echo "$choice" | tr -d '"') cleaned=$(echo "$choice" | tr -d '"')
for item in $cleaned; do for item in $cleaned; do
case $item in case $item in
install) install)
echo "gdm3 shared/default-x-display-manager select gdm3" | sudo debconf-set-selections echo "gdm3 shared/default-x-display-manager select gdm3" | sudo debconf-set-selections
_run_cmd "GDM3" "sudo apt install -y gdm3" "Installing gdm3..." _run_cmd "GDM3" "sudo apt install -y gdm3" "Installing gdm3..."
;; ;;
userlist) userlist)
local greeter_conf="/etc/gdm3/greeter.dconf-defaults" local greeter_conf="/etc/gdm3/greeter.dconf-defaults"
if sudo grep -q '^disable-user-list=true' "$greeter_conf" 2>/dev/null; then if sudo grep -q '^disable-user-list=true' "$greeter_conf" 2>/dev/null; then
sudo sed -i 's/^disable-user-list=true/# disable-user-list=true/' "$greeter_conf" sudo sed -i 's/^disable-user-list=true/# disable-user-list=true/' "$greeter_conf"
echo -e "${GREEN}User list is now VISIBLE.${NC}" echo -e "${GREEN}User list is now VISIBLE.${NC}"
else else
sudo sed -i 's/^#[[:space:]]*disable-user-list=true/disable-user-list=true/' "$greeter_conf" sudo sed -i 's/^#[[:space:]]*disable-user-list=true/disable-user-list=true/' "$greeter_conf"
echo -e "${GREEN}User list is now HIDDEN.${NC}" echo -e "${GREEN}User list is now HIDDEN.${NC}"
fi
sudo dpkg-reconfigure gdm3 >/dev/null 2>&1
;;
autologin)
local daemon_conf="/etc/gdm3/daemon.conf"
local username
username=$(whiptail --title "GDM3 Autologin" \
--inputbox "Enter username to autologin (leave empty to DISABLE autologin):" \
10 60 "" 3>&1 1>&2 2>&3 || true)
if [ -n "$username" ]; then
sudo sed -i 's/^# *AutomaticLoginEnable[[:space:]=].*/AutomaticLoginEnable=true/' "$daemon_conf"
sudo sed -i 's/^# *AutomaticLogin[[:space:]=].*/AutomaticLogin='"$username"'/' "$daemon_conf"
echo -e "${GREEN}Autologin enabled for user: ${username}${NC}"
else
sudo sed -i 's/^AutomaticLoginEnable[[:space:]=].*/# AutomaticLoginEnable=false/' "$daemon_conf"
sudo sed -i 's/^AutomaticLogin[[:space:]=].*/# AutomaticLogin=/' "$daemon_conf"
echo -e "${GREEN}Autologin disabled.${NC}"
fi
;;
wayland)
local rules_link="/etc/udev/rules.d/61-gdm.rules"
if [ -L "$rules_link" ] || [ -f "$rules_link" ]; then
sudo rm -f "$rules_link"
echo -e "${GREEN}Reverted. Wayland will be disabled by default on next reboot.${NC}"
elif [ -f "/lib/udev/rules.d/61-gdm.rules" ]; then
if _confirm "Wayland on NVIDIA" \
"Force-enable Wayland on NVIDIA?\n\nRisk: This may break graphics or cause instability.\nProceed?"; then
sudo ln -s /dev/null "$rules_link"
echo -e "${GREEN}Wayland override created. Reboot required.${NC}"
fi fi
sudo dpkg-reconfigure gdm3 >/dev/null 2>&1 fi
;; ;;
autologin)
local daemon_conf="/etc/gdm3/daemon.conf"
local username
username=$(whiptail --title "GDM3 Autologin" \
--inputbox "Enter username to autologin (leave empty to DISABLE autologin):" \
10 60 "" 3>&1 1>&2 2>&3 || true)
if [ -n "$username" ]; then
sudo sed -i 's/^# *AutomaticLoginEnable[[:space:]=].*/AutomaticLoginEnable=true/' "$daemon_conf"
sudo sed -i 's/^# *AutomaticLogin[[:space:]=].*/AutomaticLogin='"$username"'/' "$daemon_conf"
echo -e "${GREEN}Autologin enabled for user: ${username}${NC}"
else
sudo sed -i 's/^AutomaticLoginEnable[[:space:]=].*/# AutomaticLoginEnable=false/' "$daemon_conf"
sudo sed -i 's/^AutomaticLogin[[:space:]=].*/# AutomaticLogin=/' "$daemon_conf"
echo -e "${GREEN}Autologin disabled.${NC}"
fi
;;
wayland)
local rules_link="/etc/udev/rules.d/61-gdm.rules"
if [ -L "$rules_link" ] || [ -f "$rules_link" ]; then
sudo rm -f "$rules_link"
echo -e "${GREEN}Reverted. Wayland will be disabled by default on next reboot.${NC}"
elif [ -f "/lib/udev/rules.d/61-gdm.rules" ]; then
if _confirm "Wayland on NVIDIA" \
"Force-enable Wayland on NVIDIA?\n\nRisk: This may break graphics or cause instability.\nProceed?"; then
sudo ln -s /dev/null "$rules_link"
echo -e "${GREEN}Wayland override created. Reboot required.${NC}"
fi
fi
;;
esac esac
done done
_pause _pause
@@ -402,37 +402,37 @@ configure_sddm() {
[ -z "$choice" ] && return [ -z "$choice" ] && return
clear clear
case "$choice" in case "$choice" in
1) 1)
echo "sddm shared/default-x-display-manager select sddm" | sudo debconf-set-selections echo "sddm shared/default-x-display-manager select sddm" | sudo debconf-set-selections
_run_cmd "SDDM" "sudo apt install -y sddm" "Installing SDDM..." _run_cmd "SDDM" "sudo apt install -y sddm" "Installing SDDM..."
;; ;;
2) 2)
local sddm_session="" local sddm_session=""
local sddm_user="${SUDO_USER:-$USER}" local sddm_user="${SUDO_USER:-$USER}"
if [ -f /usr/share/wayland-sessions/plasmawayland.desktop ]; then if [ -f /usr/share/wayland-sessions/plasmawayland.desktop ]; then
sddm_session="plasmawayland" sddm_session="plasmawayland"
elif [ -f /usr/share/wayland-sessions/lxqt-wayland.desktop ]; then elif [ -f /usr/share/wayland-sessions/lxqt-wayland.desktop ]; then
sddm_session="lxqt-wayland" sddm_session="lxqt-wayland"
elif [ -f /usr/share/xsessions/plasma.desktop ]; then elif [ -f /usr/share/xsessions/plasma.desktop ]; then
sddm_session="plasma" sddm_session="plasma"
elif [ -f /usr/share/xsessions/lxqt.desktop ]; then elif [ -f /usr/share/xsessions/lxqt.desktop ]; then
sddm_session="lxqt" sddm_session="lxqt"
fi fi
sudo mkdir -p /etc/sddm.conf.d sudo mkdir -p /etc/sddm.conf.d
cat << EOF | sudo tee /etc/sddm.conf.d/autologin.conf > /dev/null cat <<EOF | sudo tee /etc/sddm.conf.d/autologin.conf >/dev/null
[Autologin] [Autologin]
User=${sddm_user} User=${sddm_user}
Session=${sddm_session} Session=${sddm_session}
Relogin=false Relogin=false
EOF EOF
if [ -n "$sddm_session" ]; then if [ -n "$sddm_session" ]; then
echo -e "${GREEN}Autologin enabled for user ${sddm_user}, session: ${sddm_session}.${NC}" echo -e "${GREEN}Autologin enabled for user ${sddm_user}, session: ${sddm_session}.${NC}"
else else
echo -e "${YELLOW}Autologin enabled for user ${sddm_user}. No session set (SDDM will use default).${NC}" echo -e "${YELLOW}Autologin enabled for user ${sddm_user}. No session set (SDDM will use default).${NC}"
fi fi
_pause _pause
;; ;;
3) return ;; 3) return ;;
esac esac
done done
} }
+22 -18
View File
@@ -6,7 +6,7 @@ _install_signal() {
if [ ! -f /etc/apt/sources.list.d/extrepo_signal.sources ]; then if [ ! -f /etc/apt/sources.list.d/extrepo_signal.sources ]; then
_run_cmd "Signal" "sudo extrepo enable signal" "Enabling Signal repository..." _run_cmd "Signal" "sudo extrepo enable signal" "Enabling Signal repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
if ! is_installed "signal-desktop"; then if ! is_installed "signal-desktop"; then
_run_cmd "Signal" "sudo apt install -y signal-desktop" "Installing Signal..." _run_cmd "Signal" "sudo apt install -y signal-desktop" "Installing Signal..."
echo -e "${GREEN}Signal installed.${NC}" echo -e "${GREEN}Signal installed.${NC}"
@@ -50,13 +50,16 @@ _cat_communication() {
fi fi
local -a items=() local -a items=()
local signal_state; signal_state=$(_state "signal-desktop") local signal_state
local telegram_state; telegram_state=$(_state "telegram-desktop") signal_state=$(_state "signal-desktop")
local hexchat_state; hexchat_state=$(_state "hexchat") local telegram_state
telegram_state=$(_state "telegram-desktop")
local hexchat_state
hexchat_state=$(_state "hexchat")
items+=( items+=(
"signal-desktop" "Signal Private Messenger (extrepo)" "$signal_state" "signal-desktop" "Signal Private Messenger (extrepo)" "$signal_state"
"telegram-desktop" "Telegram Desktop messaging" "$telegram_state" "telegram-desktop" "Telegram Desktop messaging" "$telegram_state"
"hexchat" "IRC client (HexChat)" "$hexchat_state" "hexchat" "IRC client (HexChat)" "$hexchat_state"
) )
local item_count=${#items[@]} local item_count=${#items[@]}
@@ -67,19 +70,20 @@ _cat_communication() {
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
signal-desktop) _install_signal ;; signal-desktop) _install_signal ;;
telegram-desktop) _install_telegram ;; telegram-desktop) _install_telegram ;;
hexchat) hexchat)
if ! is_installed "hexchat"; then if ! is_installed "hexchat"; then
_run_install "hexchat" _run_install "hexchat"
echo -e "${GREEN}hexchat installed.${NC}" echo -e "${GREEN}hexchat installed.${NC}"
else else
echo "hexchat already installed." echo "hexchat already installed."
fi fi
;; ;;
esac esac
done done
echo -e "${GREEN}Communication tools installed.${NC}" echo -e "${GREEN}Communication tools installed.${NC}"
+1 -1
View File
@@ -8,7 +8,7 @@ _enable_jellyfin_repo() {
fi fi
_run_cmd "Jellyfin" "sudo extrepo enable jellyfin" "Enabling Jellyfin repository..." _run_cmd "Jellyfin" "sudo extrepo enable jellyfin" "Enabling Jellyfin repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
install_jellyfin() { install_jellyfin() {
+166 -145
View File
@@ -16,13 +16,13 @@ _enable_mozilla_repo() {
_run_cmd "Mozilla" "sudo extrepo enable mozilla" "Enabling Mozilla repository..." _run_cmd "Mozilla" "sudo extrepo enable mozilla" "Enabling Mozilla repository..."
fi fi
if [ ! -f /etc/apt/preferences.d/mozilla ]; then if [ ! -f /etc/apt/preferences.d/mozilla ]; then
sudo tee /etc/apt/preferences.d/mozilla > /dev/null << 'EOF' sudo tee /etc/apt/preferences.d/mozilla >/dev/null <<'EOF'
Package: * Package: *
Pin: origin packages.mozilla.org Pin: origin packages.mozilla.org
Pin-Priority: 1000 Pin-Priority: 1000
EOF EOF
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
_enable_floorp_repo() { _enable_floorp_repo() {
@@ -30,7 +30,7 @@ _enable_floorp_repo() {
_ensure_extrepo _ensure_extrepo
_run_cmd "Floorp" "sudo extrepo enable floorp" "Enabling Floorp repository..." _run_cmd "Floorp" "sudo extrepo enable floorp" "Enabling Floorp repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
install_palemoon() { install_palemoon() {
@@ -60,7 +60,7 @@ install_palemoon() {
else else
_ensure_extrepo _ensure_extrepo
_run_cmd "Pale Moon" "sudo extrepo enable ${REPO_PALEMOON}" "Enabling ${REPO_PALEMOON}..." _run_cmd "Pale Moon" "sudo extrepo enable ${REPO_PALEMOON}" "Enabling ${REPO_PALEMOON}..."
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
fi fi
if ! is_installed "palemoon"; then if ! is_installed "palemoon"; then
@@ -76,7 +76,7 @@ _enable_librewolf_repo() {
_ensure_extrepo _ensure_extrepo
_run_cmd "LibreWolf" "sudo extrepo enable librewolf" "Enabling LibreWolf repository..." _run_cmd "LibreWolf" "sudo extrepo enable librewolf" "Enabling LibreWolf repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
_enable_tailscale_repo() { _enable_tailscale_repo() {
@@ -84,7 +84,7 @@ _enable_tailscale_repo() {
_ensure_extrepo _ensure_extrepo
_run_cmd "Tailscale" "sudo extrepo enable tailscale" "Enabling Tailscale repository..." _run_cmd "Tailscale" "sudo extrepo enable tailscale" "Enabling Tailscale repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
_enable_mullvad_repo() { _enable_mullvad_repo() {
@@ -92,14 +92,14 @@ _enable_mullvad_repo() {
_ensure_extrepo _ensure_extrepo
_run_cmd "Mullvad" "sudo extrepo enable mullvad" "Enabling Mullvad repository..." _run_cmd "Mullvad" "sudo extrepo enable mullvad" "Enabling Mullvad repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
install_protonvpn() { install_protonvpn() {
if [ ! -f /etc/apt/sources.list.d/extrepo_protonvpn.sources ]; then if [ ! -f /etc/apt/sources.list.d/extrepo_protonvpn.sources ]; then
_ensure_extrepo _ensure_extrepo
_run_cmd "ProtonVPN" "sudo extrepo enable protonvpn stable" "Enabling ProtonVPN repository (stable suite)..." _run_cmd "ProtonVPN" "sudo extrepo enable protonvpn stable" "Enabling ProtonVPN repository (stable suite)..."
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
else else
echo "ProtonVPN repository already enabled." echo "ProtonVPN repository already enabled."
fi fi
@@ -119,69 +119,90 @@ _cat_internet() {
_is_headless && headless=true _is_headless && headless=true
local -a items=() local -a items=()
if ! $headless; then if ! $headless; then
local chromium_state; chromium_state=$(_state "chromium") local chromium_state
local dillo_state; dillo_state=$(_state "dillo") chromium_state=$(_state "chromium")
local epiphany_state; epiphany_state=$(_state "epiphany-browser") local dillo_state
local falkon_state; falkon_state=$(_state "falkon") dillo_state=$(_state "dillo")
local epiphany_state
epiphany_state=$(_state "epiphany-browser")
local falkon_state
falkon_state=$(_state "falkon")
local firefox_state="OFF" local firefox_state="OFF"
if command -v firefox &>/dev/null && ! is_installed "firefox-esr"; then if command -v firefox &>/dev/null && ! is_installed "firefox-esr"; then
firefox_state="ON" firefox_state="ON"
fi fi
local firefox_esr_state local firefox_esr_state
firefox_esr_state=$(_state "firefox-esr") firefox_esr_state=$(_state "firefox-esr")
local floorp_state; floorp_state=$(_state "floorp") local floorp_state
local konqueror_state; konqueror_state=$(_state "konqueror") floorp_state=$(_state "floorp")
local librewolf_state; librewolf_state=$(_state "librewolf") local konqueror_state
local palemoon_state; palemoon_state=$(_state "palemoon") konqueror_state=$(_state "konqueror")
local privacybrowser_state; privacybrowser_state=$(_state "privacybrowser") local librewolf_state
local qutebrowser_state; qutebrowser_state=$(_state "qutebrowser") librewolf_state=$(_state "librewolf")
local thunderbird_state; thunderbird_state=$(_state "thunderbird") local palemoon_state
local torbrowser_state; torbrowser_state=$(_state "torbrowser-launcher") palemoon_state=$(_state "palemoon")
local mullvadbrowser_state; mullvadbrowser_state=$(_state "mullvad-browser") local privacybrowser_state
local protonvpn_state; protonvpn_state=$(_state "protonvpn") privacybrowser_state=$(_state "privacybrowser")
local qutebrowser_state
qutebrowser_state=$(_state "qutebrowser")
local thunderbird_state
thunderbird_state=$(_state "thunderbird")
local torbrowser_state
torbrowser_state=$(_state "torbrowser-launcher")
local mullvadbrowser_state
mullvadbrowser_state=$(_state "mullvad-browser")
local protonvpn_state
protonvpn_state=$(_state "protonvpn")
items+=( items+=(
"chromium" "Chromium web browser" "$chromium_state" "chromium" "Chromium web browser" "$chromium_state"
"dillo" "Lightweight graphical browser" "$dillo_state" "dillo" "Lightweight graphical browser" "$dillo_state"
"epiphany-browser" "GNOME web browser" "$epiphany_state" "epiphany-browser" "GNOME web browser" "$epiphany_state"
"falkon" "KDE web browser (QtWebEngine)" "$falkon_state" "falkon" "KDE web browser (QtWebEngine)" "$falkon_state"
"firefox" "Firefox from Mozilla (replaces ESR)" "$firefox_state" "firefox" "Firefox from Mozilla (replaces ESR)" "$firefox_state"
"firefox-esr" "Firefox ESR (official Debian + locale auto)" "$firefox_esr_state" "firefox-esr" "Firefox ESR (official Debian + locale auto)" "$firefox_esr_state"
"floorp" "Firefox-based browser (extrepo)" "$floorp_state" "floorp" "Firefox-based browser (extrepo)" "$floorp_state"
"konqueror" "KDE file manager / web browser" "$konqueror_state" "konqueror" "KDE file manager / web browser" "$konqueror_state"
"librewolf" "Privacy-focused Firefox fork (extrepo)" "$librewolf_state" "librewolf" "Privacy-focused Firefox fork (extrepo)" "$librewolf_state"
"palemoon" "Classic Firefox-derived browser (extrepo)" "$palemoon_state" "palemoon" "Classic Firefox-derived browser (extrepo)" "$palemoon_state"
"privacybrowser" "Privacy-focused web browser" "$privacybrowser_state" "privacybrowser" "Privacy-focused web browser" "$privacybrowser_state"
"qutebrowser" "Keyboard-driven browser (Qt)" "$qutebrowser_state" "qutebrowser" "Keyboard-driven browser (Qt)" "$qutebrowser_state"
"thunderbird" "Email client" "$thunderbird_state" "thunderbird" "Email client" "$thunderbird_state"
"torbrowser-launcher" "Tor Browser launcher" "$torbrowser_state" "torbrowser-launcher" "Tor Browser launcher" "$torbrowser_state"
"mullvad-browser" "Mullvad privacy browser" "$mullvadbrowser_state" "mullvad-browser" "Mullvad privacy browser" "$mullvadbrowser_state"
"protonvpn" "ProtonVPN client" "$protonvpn_state" "protonvpn" "ProtonVPN client" "$protonvpn_state"
) )
fi fi
local elinks_state; elinks_state=$(_state "elinks") local elinks_state
local riseupvpn_state; riseupvpn_state=$(_state "riseup-vpn") elinks_state=$(_state "elinks")
local w3m_state; w3m_state=$(_state "w3m") local riseupvpn_state
local tailscale_state; tailscale_state=$(_state "tailscale") riseupvpn_state=$(_state "riseup-vpn")
local mullvad_state; mullvad_state=$(_state "mullvad-vpn") local w3m_state
w3m_state=$(_state "w3m")
local tailscale_state
tailscale_state=$(_state "tailscale")
local mullvad_state
mullvad_state=$(_state "mullvad-vpn")
items+=( items+=(
"elinks" "Text-mode web browser" "$elinks_state" "elinks" "Text-mode web browser" "$elinks_state"
"riseup-vpn" "Riseup VPN client" "$riseupvpn_state" "riseup-vpn" "Riseup VPN client" "$riseupvpn_state"
"w3m" "Text-mode browser + deps (w3m-img)" "$w3m_state" "w3m" "Text-mode browser + deps (w3m-img)" "$w3m_state"
"tailscale" "Zero-config VPN & mesh networking" "$tailscale_state" "tailscale" "Zero-config VPN & mesh networking" "$tailscale_state"
"mullvad-vpn" "Mullvad VPN client (WireGuard)" "$mullvad_state" "mullvad-vpn" "Mullvad VPN client (WireGuard)" "$mullvad_state"
) )
local item_count=${#items[@]} local item_count=${#items[@]}
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Internet" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"${items[@]}" \ _checklist "Internet" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
) "${items[@]}"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
local has_firefox=false local has_firefox=false
local has_firefox_esr=false local has_firefox_esr=false
@@ -194,76 +215,76 @@ _cat_internet() {
if $has_firefox && $has_firefox_esr; then if $has_firefox && $has_firefox_esr; then
fchoice=$(_menu "Firefox" "You selected both Firefox (Mozilla) and Firefox ESR.\nWhat do you want to do?" 12 60 3 \ fchoice=$(_menu "Firefox" "You selected both Firefox (Mozilla) and Firefox ESR.\nWhat do you want to do?" 12 60 3 \
"mozilla" "Remove Firefox ESR — keep Firefox" \ "mozilla" "Remove Firefox ESR — keep Firefox" \
"esr" "Remove Firefox — keep Firefox ESR" \ "esr" "Remove Firefox — keep Firefox ESR" \
"both" "Keep both variants") "both" "Keep both variants")
[ -z "$fchoice" ] && return [ -z "$fchoice" ] && return
case "$fchoice" in case "$fchoice" in
mozilla) cleaned=$(printf '%s\n' $cleaned | grep -vx "firefox-esr" | tr '\n' ' ') ;; mozilla) cleaned=$(printf '%s\n' $cleaned | grep -vx "firefox-esr" | tr '\n' ' ') ;;
esr) cleaned=$(printf '%s\n' $cleaned | grep -vx "firefox" | tr '\n' ' ') ;; esr) cleaned=$(printf '%s\n' $cleaned | grep -vx "firefox" | tr '\n' ' ') ;;
esac esac
fi fi
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
firefox) firefox)
install_firefox_mozilla "$fchoice" install_firefox_mozilla "$fchoice"
;; ;;
firefox-esr) firefox-esr)
install_firefox_esr "$fchoice" install_firefox_esr "$fchoice"
;; ;;
floorp) floorp)
_enable_floorp_repo _enable_floorp_repo
_run_install floorp _run_install floorp
echo -e "${GREEN}Floorp installed.${NC}" echo -e "${GREEN}Floorp installed.${NC}"
;; ;;
librewolf) librewolf)
_enable_librewolf_repo _enable_librewolf_repo
_run_install librewolf _run_install librewolf
echo -e "${GREEN}LibreWolf installed.${NC}" echo -e "${GREEN}LibreWolf installed.${NC}"
;; ;;
palemoon) palemoon)
install_palemoon install_palemoon
;; ;;
tailscale) tailscale)
_enable_tailscale_repo _enable_tailscale_repo
_run_install tailscale _run_install tailscale
echo -e "${GREEN}Tailscale installed.${NC}" echo -e "${GREEN}Tailscale installed.${NC}"
;; ;;
mullvad-vpn) mullvad-vpn)
_enable_mullvad_repo _enable_mullvad_repo
_run_install mullvad-vpn _run_install mullvad-vpn
echo -e "${GREEN}Mullvad VPN installed.${NC}" echo -e "${GREEN}Mullvad VPN installed.${NC}"
;; ;;
mullvad-browser) mullvad-browser)
_enable_mullvad_repo _enable_mullvad_repo
_run_install mullvad-browser _run_install mullvad-browser
echo -e "${GREEN}Mullvad Browser installed.${NC}" echo -e "${GREEN}Mullvad Browser installed.${NC}"
;; ;;
protonvpn) protonvpn)
install_protonvpn install_protonvpn
;; ;;
riseup-vpn) riseup-vpn)
install_backports_or_stable riseup-vpn install_backports_or_stable riseup-vpn
;; ;;
w3m) w3m)
local need=() local need=()
! is_installed "w3m" && need+=("w3m") ! is_installed "w3m" && need+=("w3m")
! is_installed "w3m-img" && need+=("w3m-img") ! is_installed "w3m-img" && need+=("w3m-img")
! is_installed "ca-certificates" && need+=("ca-certificates") ! is_installed "ca-certificates" && need+=("ca-certificates")
! is_installed "xsel" && need+=("xsel") ! is_installed "xsel" && need+=("xsel")
if [ ${#need[@]} -gt 0 ]; then if [ ${#need[@]} -gt 0 ]; then
_run_install_batch w3m w3m-img ca-certificates xsel _run_install_batch w3m w3m-img ca-certificates xsel
else else
echo "w3m already installed." echo "w3m already installed."
fi fi
;; ;;
*) *)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
;; ;;
esac esac
done done
@@ -284,22 +305,22 @@ install_firefox_mozilla() {
if is_installed "firefox-esr"; then if is_installed "firefox-esr"; then
case "$fchoice" in case "$fchoice" in
both) both)
echo -e "${CYAN}[INFO] Keeping Firefox ESR (both selected).${NC}" echo -e "${CYAN}[INFO] Keeping Firefox ESR (both selected).${NC}"
;; ;;
mozilla) mozilla)
echo "Removing Firefox ESR (as selected)..." echo "Removing Firefox ESR (as selected)..."
sudo apt remove -y firefox-esr
;;
*)
if _confirm "Firefox ESR" "Firefox ESR is installed.\nRemove it before installing Mozilla Firefox?"; then
echo "Removing Firefox ESR..."
sudo apt remove -y firefox-esr sudo apt remove -y firefox-esr
;; else
*) echo "Keeping Firefox ESR."
if _confirm "Firefox ESR" "Firefox ESR is installed.\nRemove it before installing Mozilla Firefox?"; then return
echo "Removing Firefox ESR..." fi
sudo apt remove -y firefox-esr ;;
else
echo "Keeping Firefox ESR."
return
fi
;;
esac esac
fi fi
@@ -317,22 +338,22 @@ install_firefox_esr() {
if command -v firefox &>/dev/null; then if command -v firefox &>/dev/null; then
case "$fchoice" in case "$fchoice" in
both) both)
echo -e "${CYAN}[INFO] Keeping Mozilla Firefox (both selected).${NC}" echo -e "${CYAN}[INFO] Keeping Mozilla Firefox (both selected).${NC}"
;; ;;
esr) esr)
echo "Removing Mozilla Firefox (as selected)..." echo "Removing Mozilla Firefox (as selected)..."
sudo apt remove -y firefox
;;
*)
if _confirm "Firefox" "Mozilla Firefox is installed.\nRemove it before installing Firefox ESR?"; then
echo "Removing Mozilla Firefox..."
sudo apt remove -y firefox sudo apt remove -y firefox
;; else
*) echo "Keeping Mozilla Firefox."
if _confirm "Firefox" "Mozilla Firefox is installed.\nRemove it before installing Firefox ESR?"; then return
echo "Removing Mozilla Firefox..." fi
sudo apt remove -y firefox ;;
else
echo "Keeping Mozilla Firefox."
return
fi
;;
esac esac
fi fi
+10 -4
View File
@@ -10,18 +10,21 @@ _enable_temurin_repo() {
_run_cmd "extrepo" "sudo apt install -y extrepo" "Installing extrepo..." _run_cmd "extrepo" "sudo apt install -y extrepo" "Installing extrepo..."
fi fi
_run_cmd "Temurin" "sudo extrepo enable temurin" "Enabling Adoptium Temurin repository..." _run_cmd "Temurin" "sudo extrepo enable temurin" "Enabling Adoptium Temurin repository..."
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
install_minecraft_java() { install_minecraft_java() {
local choices local choices
choices=$(_checklist "Java Runtimes for Minecraft" \ choices=$(_checklist "Java Runtimes for Minecraft" \
"Select Java version(s) to install:" 15 65 4 \ "Select Java version(s) to install:" 15 65 4 \
"8" "Java 8 — Classic mods & Minecraft <= 1.16.5" OFF \ "8" "Java 8 — Classic mods & Minecraft <= 1.16.5" OFF \
"17" "Java 17 — Minecraft 1.17 to 1.20.4" ON \ "17" "Java 17 — Minecraft 1.17 to 1.20.4" ON \
"21" "Java 21 — Modern Minecraft >= 1.20.5 & 1.21+" OFF \ "21" "Java 21 — Modern Minecraft >= 1.20.5 & 1.21+" OFF \
"25" "Java 25 — Minecraft 26+" OFF) "25" "Java 25 — Minecraft 26+" OFF)
[ -z "$choices" ] && { echo "No Java version selected."; return; } [ -z "$choices" ] && {
echo "No Java version selected."
return
}
_enable_temurin_repo _enable_temurin_repo
local cleaned local cleaned
cleaned=$(echo "$choices" | tr -d '"') cleaned=$(echo "$choices" | tr -d '"')
@@ -38,7 +41,10 @@ _install_dev_java() {
"17" "Java 17 LTS Development Kit" \ "17" "Java 17 LTS Development Kit" \
"21" "Java 21 LTS Development Kit" \ "21" "Java 21 LTS Development Kit" \
"25" "Java 25 LTS Development Kit") "25" "Java 25 LTS Development Kit")
[ -z "$ver" ] && { echo "No JDK version selected."; return; } [ -z "$ver" ] && {
echo "No JDK version selected."
return
}
_enable_temurin_repo _enable_temurin_repo
_run_install "temurin-${ver}-jdk" _run_install "temurin-${ver}-jdk"
} }
+13 -11
View File
@@ -10,7 +10,7 @@ _enable_onlyoffice_repo() {
fi fi
_run_cmd "OnlyOffice" "sudo extrepo enable onlyoffice-desktopeditors" "Enabling OnlyOffice repository..." _run_cmd "OnlyOffice" "sudo extrepo enable onlyoffice-desktopeditors" "Enabling OnlyOffice repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
install_onlyoffice() { install_onlyoffice() {
@@ -36,7 +36,7 @@ install_joplin() {
if [ ! -f /etc/apt/sources.list.d/extrepo_joplin.sources ]; then if [ ! -f /etc/apt/sources.list.d/extrepo_joplin.sources ]; then
_run_cmd "Joplin" "sudo extrepo enable joplin" "Enabling Joplin repository..." _run_cmd "Joplin" "sudo extrepo enable joplin" "Enabling Joplin repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
if ! is_installed "joplin"; then if ! is_installed "joplin"; then
_run_cmd "Joplin" "sudo apt install -y joplin" "Installing Joplin..." _run_cmd "Joplin" "sudo apt install -y joplin" "Installing Joplin..."
echo -e "${GREEN}Joplin installed.${NC}" echo -e "${GREEN}Joplin installed.${NC}"
@@ -84,8 +84,8 @@ _cat_office() {
local -a items=() local -a items=()
if ! $headless; then if ! $headless; then
items+=( items+=(
"onlyoffice" "OnlyOffice Desktop Editors (extrepo)" OFF "onlyoffice" "OnlyOffice Desktop Editors (extrepo)" OFF
"libreoffice" "LibreOffice (backports on Bookworm/Trixie)" OFF "libreoffice" "LibreOffice (backports on Bookworm/Trixie)" OFF
) )
if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then if [ "$DEBIAN_VERSION" = "12" ] || [ "$DEBIAN_VERSION" = "13" ]; then
items+=( items+=(
@@ -97,18 +97,20 @@ _cat_office() {
local item_count=${#items[@]} local item_count=${#items[@]}
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Office & Productivity" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"${items[@]}" \ _checklist "Office & Productivity" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
) "${items[@]}"
)
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
onlyoffice) install_onlyoffice ;; onlyoffice) install_onlyoffice ;;
libreoffice) install_libreoffice_bpo ;; libreoffice) install_libreoffice_bpo ;;
joplin) install_joplin ;; joplin) install_joplin ;;
esac esac
done done
} }
+51 -38
View File
@@ -5,64 +5,77 @@ _cat_programming() {
local headless=false local headless=false
_is_headless && headless=true _is_headless && headless=true
local -a items=() local -a items=()
local vim_state; vim_state=$(_state "vim") local vim_state
local neovim_state; neovim_state=$(_state "neovim") vim_state=$(_state "vim")
local hx_state; hx_state=$(_state "hx") local neovim_state
local nano_state; nano_state=$(_state "nano") neovim_state=$(_state "neovim")
local emacs_state; emacs_state=$(_state "emacs") local hx_state
hx_state=$(_state "hx")
local nano_state
nano_state=$(_state "nano")
local emacs_state
emacs_state=$(_state "emacs")
items+=( items+=(
"vim" "Classic terminal editor" "$vim_state" "vim" "Classic terminal editor" "$vim_state"
"neovim" "Modern vim fork" "$neovim_state" "neovim" "Modern vim fork" "$neovim_state"
"hx" "Helix modal editor (Rust)" "$hx_state" "hx" "Helix modal editor (Rust)" "$hx_state"
"nano" "Simple terminal editor" "$nano_state" "nano" "Simple terminal editor" "$nano_state"
"emacs" "Extensible editor / IDE" "$emacs_state" "emacs" "Extensible editor / IDE" "$emacs_state"
) )
if ! $headless; then if ! $headless; then
local vimgtk_state; vimgtk_state=$(_state "vim-gtk3") local vimgtk_state
local kate_state; kate_state=$(_state "kate") vimgtk_state=$(_state "vim-gtk3")
local mousepad_state; mousepad_state=$(_state "mousepad") local kate_state
local gedit_state; gedit_state=$(_state "gedit") kate_state=$(_state "kate")
local geany_state; geany_state=$(_state "geany") local mousepad_state
local gte_state; gte_state=$(_state "gnome-text-editor") mousepad_state=$(_state "mousepad")
local gedit_state
gedit_state=$(_state "gedit")
local geany_state
geany_state=$(_state "geany")
local gte_state
gte_state=$(_state "gnome-text-editor")
local codium_state="OFF" local codium_state="OFF"
if command -v codium &>/dev/null; then if command -v codium &>/dev/null; then
codium_state="ON" codium_state="ON"
fi fi
items+=( items+=(
"vim-gtk3" "Vim with GTK3 GUI" "$vimgtk_state" "vim-gtk3" "Vim with GTK3 GUI" "$vimgtk_state"
"kate" "KDE advanced text editor" "$kate_state" "kate" "KDE advanced text editor" "$kate_state"
"mousepad" "Xfce text editor" "$mousepad_state" "mousepad" "Xfce text editor" "$mousepad_state"
"gedit" "GNOME text editor" "$gedit_state" "gedit" "GNOME text editor" "$gedit_state"
"geany" "Lightweight IDE" "$geany_state" "geany" "Lightweight IDE" "$geany_state"
"gnome-text-editor" "GNOME modern text editor" "$gte_state" "gnome-text-editor" "GNOME modern text editor" "$gte_state"
"vscodium" "VS Code open-source (extrepo)" "$codium_state" "vscodium" "VS Code open-source (extrepo)" "$codium_state"
) )
fi fi
local item_count=${#items[@]} local item_count=${#items[@]}
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "Programming Applications" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"${items[@]}" \ _checklist "Programming Applications" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
) "${items[@]}"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
vscodium) vscodium)
install_vscodium install_vscodium
;; ;;
*) *)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
_run_install "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
;; ;;
esac esac
done done
@@ -76,7 +89,7 @@ _enable_vscodium_repo() {
fi fi
_run_cmd "VSCodium" "sudo extrepo enable vscodium" "Enabling VSCodium repository..." _run_cmd "VSCodium" "sudo extrepo enable vscodium" "Enabling VSCodium repository..."
fi fi
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
} }
install_vscodium() { install_vscodium() {
+215 -183
View File
@@ -7,10 +7,14 @@ _detect_desktop_type() {
desktop="${desktop,,}" desktop="${desktop,,}"
case "$desktop" in case "$desktop" in
*kde*|*lxqt*|*razor*|*plasma*) *kde* | *lxqt* | *razor* | *plasma*)
echo "qt"; return ;; echo "qt"
*gnome*|*xfce*|*cinnamon*|*mate*|*lxde*|*budgie*|*sway*|*hyprland*|*i3*|*bspwm*|*openbox*|*fluxbox*) return
echo "gtk"; return ;; ;;
*gnome* | *xfce* | *cinnamon* | *mate* | *lxde* | *budgie* | *sway* | *hyprland* | *i3* | *bspwm* | *openbox* | *fluxbox*)
echo "gtk"
return
;;
esac esac
echo "gtk" echo "gtk"
@@ -20,224 +24,252 @@ _cat_general() {
local headless=false local headless=false
_is_headless && headless=true _is_headless && headless=true
local -a items=() local -a items=()
local btop_state; btop_state=$(_state "btop") local btop_state
btop_state=$(_state "btop")
local compress_state local compress_state
if is_installed "zip" && is_installed "unzip" && is_installed "p7zip-full"; then if is_installed "zip" && is_installed "unzip" && is_installed "p7zip-full"; then
compress_state="ON" compress_state="ON"
else else
compress_state="OFF" compress_state="OFF"
fi fi
local cpufetch_state; cpufetch_state=$(_state "cpufetch") local cpufetch_state
local cpu_x_state; cpu_x_state=$(_state "cpu-x") cpufetch_state=$(_state "cpufetch")
local cpu_x_state
cpu_x_state=$(_state "cpu-x")
local curl_wget_state local curl_wget_state
if is_installed "curl" && is_installed "wget"; then if is_installed "curl" && is_installed "wget"; then
curl_wget_state="ON" curl_wget_state="ON"
else else
curl_wget_state="OFF" curl_wget_state="OFF"
fi fi
local extrepo_state; extrepo_state=$(_state "extrepo") local extrepo_state
local fwupd_state; fwupd_state=$(_state "fwupd") extrepo_state=$(_state "extrepo")
local htop_state; htop_state=$(_state "htop") local fwupd_state
local inxi_state; inxi_state=$(_state "inxi") fwupd_state=$(_state "fwupd")
local jq_state; jq_state=$(_state "jq") local htop_state
local kvm_state; kvm_state=$(_state "virt-manager") htop_state=$(_state "htop")
local lshw_state; lshw_state=$(_state "lshw") local inxi_state
local mc_state; mc_state=$(_state "mc") inxi_state=$(_state "inxi")
local nala_state; nala_state=$(_state "nala") local jq_state
local ncdu_state; ncdu_state=$(_state "ncdu") jq_state=$(_state "jq")
local tmux_state; tmux_state=$(_state "tmux") local kvm_state
local wine_state; wine_state=$(_state "wine") kvm_state=$(_state "virt-manager")
local nvme_state; nvme_state=$(_state "nvme-cli") local lshw_state
lshw_state=$(_state "lshw")
local mc_state
mc_state=$(_state "mc")
local nala_state
nala_state=$(_state "nala")
local ncdu_state
ncdu_state=$(_state "ncdu")
local tmux_state
tmux_state=$(_state "tmux")
local wine_state
wine_state=$(_state "wine")
local nvme_state
nvme_state=$(_state "nvme-cli")
items+=( items+=(
"btop" "Resource monitor (fancy top)" "$btop_state" "btop" "Resource monitor (fancy top)" "$btop_state"
"compress" "Compression tools (zip, unrar, 7z)" "$compress_state" "compress" "Compression tools (zip, unrar, 7z)" "$compress_state"
"cpufetch" "CPU info fetcher" "$cpufetch_state" "cpufetch" "CPU info fetcher" "$cpufetch_state"
"cpu-x" "CPU-X (alternative to CPU-Z)" "$cpu_x_state" "cpu-x" "CPU-X (alternative to CPU-Z)" "$cpu_x_state"
"curl-wget" "HTTP transfer tools (curl, wget)" "$curl_wget_state" "curl-wget" "HTTP transfer tools (curl, wget)" "$curl_wget_state"
"extrepo" "External repository manager" "$extrepo_state" "extrepo" "External repository manager" "$extrepo_state"
"fwupd" "Firmware update daemon" "$fwupd_state" "fwupd" "Firmware update daemon" "$fwupd_state"
"htop" "Interactive process viewer" "$htop_state" "htop" "Interactive process viewer" "$htop_state"
"inxi" "System information tool" "$inxi_state" "inxi" "System information tool" "$inxi_state"
"jq" "JSON command-line processor" "$jq_state" "jq" "JSON command-line processor" "$jq_state"
"kvm" "QEMU/KVM virtualization" "$kvm_state" "kvm" "QEMU/KVM virtualization" "$kvm_state"
"lshw" "List hardware details" "$lshw_state" "lshw" "List hardware details" "$lshw_state"
"mc" "Midnight Commander (file manager)" "$mc_state" "mc" "Midnight Commander (file manager)" "$mc_state"
"nala" "APT frontend (parallel downloads)" "$nala_state" "nala" "APT frontend (parallel downloads)" "$nala_state"
"ncdu" "Disk usage analyzer (ncurses)" "$ncdu_state" "ncdu" "Disk usage analyzer (ncurses)" "$ncdu_state"
"nvme-cli" "NVMe SSD health monitoring" "$nvme_state" "nvme-cli" "NVMe SSD health monitoring" "$nvme_state"
"tmux" "Terminal multiplexer" "$tmux_state" "tmux" "Terminal multiplexer" "$tmux_state"
"wine" "Windows compatibility layer" "$wine_state" "wine" "Windows compatibility layer" "$wine_state"
) )
if ! $headless; then if ! $headless; then
local bleachbit_state; bleachbit_state=$(_state "bleachbit") local bleachbit_state
local conky_state; conky_state=$(_state "conky") bleachbit_state=$(_state "bleachbit")
local gdebi_state; gdebi_state=$(_state "gdebi") local conky_state
local corectrl_state; corectrl_state=$(_state "corectrl") conky_state=$(_state "conky-all")
local dcgtk_state; dcgtk_state=$(_state "doublecmd-gtk") local gdebi_state
local dcqt_state; dcqt_state=$(_state "doublecmd-qt") gdebi_state=$(_state "gdebi")
local disks_state; disks_state=$(_state "gnome-disk-utility") local corectrl_state
local gparted_state; gparted_state=$(_state "gparted") corectrl_state=$(_state "corectrl")
local hardinfo_state; hardinfo_state=$(_state "hardinfo") local dcgtk_state
local psensor_state; psensor_state=$(_state "psensor") dcgtk_state=$(_state "doublecmd-gtk")
local timeshift_state; timeshift_state=$(_state "timeshift") local dcqt_state
dcqt_state=$(_state "doublecmd-qt")
local disks_state
disks_state=$(_state "gnome-disk-utility")
local gparted_state
gparted_state=$(_state "gparted")
local hardinfo_state
hardinfo_state=$(_state "hardinfo")
local psensor_state
psensor_state=$(_state "psensor")
local timeshift_state
timeshift_state=$(_state "timeshift")
items+=( items+=(
"bleachbit" "System cleaner (GUI)" "$bleachbit_state" "bleachbit" "System cleaner (GUI)" "$bleachbit_state"
"conky" "System monitor for desktop" "$conky_state" "conky-all" "System monitor for desktop" "$conky_state"
"gdebi" "Install .deb packages with deps" "$gdebi_state" "gdebi" "Install .deb packages with deps" "$gdebi_state"
"corectrl" "AMD GPU control (CoreCtrl)" "$corectrl_state" "corectrl" "AMD GPU control (CoreCtrl)" "$corectrl_state"
"doublecmd-gtk" "Dual-panel file manager (GTK)" "$dcgtk_state" "doublecmd-gtk" "Dual-panel file manager (GTK)" "$dcgtk_state"
"doublecmd-qt" "Dual-panel file manager (Qt)" "$dcqt_state" "doublecmd-qt" "Dual-panel file manager (Qt)" "$dcqt_state"
"gnome-disk-utility" "Disk management GUI" "$disks_state" "gnome-disk-utility" "Disk management GUI" "$disks_state"
"gparted" "GNOME partition editor" "$gparted_state" "gparted" "GNOME partition editor" "$gparted_state"
"hardinfo" "Graphical system profiler" "$hardinfo_state" "hardinfo" "Graphical system profiler" "$hardinfo_state"
"psensor" "Hardware temperature monitor" "$psensor_state" "psensor" "Hardware temperature monitor" "$psensor_state"
"timeshift" "System restore snapshots" "$timeshift_state" "timeshift" "System restore snapshots" "$timeshift_state"
) )
fi fi
local item_count=${#items[@]} local item_count=${#items[@]}
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count)) local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
local choices local choices
choices=$(_checklist "System Tools" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \ choices=$(
"${items[@]}" \ _checklist "System Tools" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
) "${items[@]}"
)
clear clear
[ -z "$choices" ] && return [ -z "$choices" ] && return
local cleaned; cleaned=$(echo "$choices" | tr -d '"') local cleaned
cleaned=$(echo "$choices" | tr -d '"')
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
compress) compress)
local need=() local need=()
! is_installed "zip" && need+=("zip") ! is_installed "zip" && need+=("zip")
! is_installed "unzip" && need+=("unzip") ! is_installed "unzip" && need+=("unzip")
! is_installed "rar" && need+=("rar") ! is_installed "rar" && need+=("rar")
! is_installed "unrar" && need+=("unrar") ! is_installed "unrar" && need+=("unrar")
! is_installed "p7zip-full" && need+=("p7zip-full") ! is_installed "p7zip-full" && need+=("p7zip-full")
! is_installed "p7zip-rar" && need+=("p7zip-rar") ! is_installed "p7zip-rar" && need+=("p7zip-rar")
if [ ${#need[@]} -gt 0 ]; then if [ ${#need[@]} -gt 0 ]; then
_run_install_batch "${need[@]}" _run_install_batch "${need[@]}"
echo -e "${GREEN}Compression utilities installed.${NC}" echo -e "${GREEN}Compression utilities installed.${NC}"
fi fi
;; ;;
curl-wget) curl-wget)
local need=() local need=()
! is_installed "curl" && need+=("curl") ! is_installed "curl" && need+=("curl")
! is_installed "wget" && need+=("wget") ! is_installed "wget" && need+=("wget")
if [ ${#need[@]} -gt 0 ]; then if [ ${#need[@]} -gt 0 ]; then
_run_install_batch "${need[@]}" _run_install_batch "${need[@]}"
else else
echo "curl and wget already installed." echo "curl and wget already installed."
fi fi
;; ;;
extrepo) extrepo)
install_backports_or_stable extrepo install_backports_or_stable extrepo
;; ;;
fwupd) fwupd)
if ! is_installed "fwupd"; then if ! is_installed "fwupd"; then
_run_cmd "fwupd" "sudo apt install -y fwupd" "Installing fwupd..." _run_cmd "fwupd" "sudo apt install -y fwupd" "Installing fwupd..."
else else
echo "fwupd already installed." echo "fwupd already installed."
fi fi
if _confirm "Firmware Scan" "Scan for firmware updates now?\n\nThis will run:\n fwupdmgr refresh\n fwupdmgr get-updates\n fwupdmgr update (if available)"; then if _confirm "Firmware Scan" "Scan for firmware updates now?\n\nThis will run:\n fwupdmgr refresh\n fwupdmgr get-updates\n fwupdmgr update (if available)"; then
_run_cmd "fwupd" "sudo fwupdmgr refresh --force" "Refreshing firmware metadata..." _run_cmd "fwupd" "sudo fwupdmgr refresh --force" "Refreshing firmware metadata..."
echo "" echo ""
echo "Checking for firmware updates..." echo "Checking for firmware updates..."
sudo fwupdmgr get-updates 2>&1 || true sudo fwupdmgr get-updates 2>&1 || true
if sudo fwupdmgr get-updates 2>&1 | grep -q "available"; then if sudo fwupdmgr get-updates 2>&1 | grep -q "available"; then
if _confirm "Firmware Update" "Firmware updates are available.\nInstall them now?"; then if _confirm "Firmware Update" "Firmware updates are available.\nInstall them now?"; then
_run_cmd "fwupd" "sudo fwupdmgr update -y" "Installing firmware updates..." _run_cmd "fwupd" "sudo fwupdmgr update -y" "Installing firmware updates..."
else
echo "Skipping firmware update."
_pause
fi
else else
echo "No firmware updates available." echo "Skipping firmware update."
_pause
fi
else
echo "No firmware updates available."
_pause _pause
fi
fi fi
echo -e "${GREEN}fwupd setup complete.${NC}" fi
_pause echo -e "${GREEN}fwupd setup complete.${NC}"
;; _pause
kvm) ;;
if ! is_installed "virt-manager"; then kvm)
_run_cmd "KVM" "sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager" "Installing KVM..." if ! is_installed "virt-manager"; then
sudo adduser "$USER" libvirt 2>/dev/null || true _run_cmd "KVM" "sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager" "Installing KVM..."
sudo adduser "$USER" kvm 2>/dev/null || true sudo adduser "$USER" libvirt 2>/dev/null || true
echo -e "${GREEN}QEMU/KVM installed. A reboot is recommended.${NC}" sudo adduser "$USER" kvm 2>/dev/null || true
echo -e "${GREEN}QEMU/KVM installed. A reboot is recommended.${NC}"
else
echo "QEMU/KVM already installed."
fi
;;
wine)
if ! is_installed "wine64"; then
_run_cmd "Wine" "sudo apt install -y --no-install-recommends wine64 fonts-wine" "Installing Wine (64-bit only)..."
local wine_ver
wine_ver=$(wine --version 2>/dev/null)
if [ -n "$wine_ver" ]; then
echo -e "${GREEN}Wine (64-bit) installed: ${wine_ver}${NC}"
else else
echo "QEMU/KVM already installed." echo -e "${YELLOW}Wine installed but version check failed.${NC}"
fi fi
;; else
wine) echo "Wine64 already installed."
if ! is_installed "wine64"; then fi
_run_cmd "Wine" "sudo apt install -y --no-install-recommends wine64 fonts-wine" "Installing Wine (64-bit only)..." ;;
local wine_ver nvme-cli)
wine_ver=$(wine --version 2>/dev/null) if ! timeout 2 lsblk -d -o TRAN 2>/dev/null | grep -q "^nvme$"; then
if [ -n "$wine_ver" ]; then echo "No NVMe controller detected. Skipping."
echo -e "${GREEN}Wine (64-bit) installed: ${wine_ver}${NC}" continue
else fi
echo -e "${YELLOW}Wine installed but version check failed.${NC}" if ! is_installed "nvme-cli"; then
fi _run_cmd "nvme-cli" "sudo apt install -y nvme-cli" "Installing nvme-cli..."
else fi
echo "Wine64 already installed." local nvme_devs=()
fi while read -r dev; do
;; nvme_devs+=("$dev")
nvme-cli) done < <(timeout 2 lsblk -d -o NAME,TRAN 2>/dev/null | awk '$2 == "nvme" {print $1}')
if ! timeout 2 lsblk -d -o TRAN 2>/dev/null | grep -q "^nvme$"; then if [ ${#nvme_devs[@]} -eq 0 ]; then
echo "No NVMe controller detected. Skipping." echo "No NVMe block devices found for health check."
continue continue
fi fi
if ! is_installed "nvme-cli"; then local dev_list=""
_run_cmd "nvme-cli" "sudo apt install -y nvme-cli" "Installing nvme-cli..." local dev
fi for dev in "${nvme_devs[@]}"; do
local nvme_devs=() [ -n "$dev_list" ] && dev_list+=", "
while read -r dev; do dev_list+="/dev/${dev}"
nvme_devs+=("$dev") done
done < <(timeout 2 lsblk -d -o NAME,TRAN 2>/dev/null | awk '$2 == "nvme" {print $1}') if _confirm "NVMe Health" "Run smart-log on ${#nvme_devs[@]} NVMe device(s): ${dev_list}?"; then
if [ ${#nvme_devs[@]} -eq 0 ]; then echo ""
echo "No NVMe block devices found for health check."
continue
fi
local dev_list=""
local dev
for dev in "${nvme_devs[@]}"; do for dev in "${nvme_devs[@]}"; do
[ -n "$dev_list" ] && dev_list+=", " local cw="" temp="" pu=""
dev_list+="/dev/${dev}" while IFS= read -r line; do
done case "$line" in
if _confirm "NVMe Health" "Run smart-log on ${#nvme_devs[@]} NVMe device(s): ${dev_list}?"; then *critical_warning*) cw="${line##*: }" ;;
*temperature*) temp="${line##*: }" ;;
*percentage_used*) pu="${line##*: }" ;;
esac
done < <(sudo nvme smart-log "/dev/${dev}" 2>/dev/null || true)
echo -e "${YELLOW}━━━ /dev/${dev} ━━━${NC}"
echo -e " ${GREEN}Critical Warning:${NC} ${cw:-N/A}"
echo -e " ${GREEN}Temperature:${NC} ${temp:-N/A}"
echo -e " ${GREEN}Percentage Used:${NC} ${pu:-N/A}"
echo "" echo ""
for dev in "${nvme_devs[@]}"; do done
local cw="" temp="" pu="" _pause
while IFS= read -r line; do fi
case "$line" in ;;
*critical_warning*) cw="${line##*: }" ;; *)
*temperature*) temp="${line##*: }" ;; if ! is_installed "$pkg"; then
*percentage_used*) pu="${line##*: }" ;; _run_install "$pkg"
esac else
done < <(sudo nvme smart-log "/dev/${dev}" 2>/dev/null || true) echo "$pkg already installed."
echo -e "${YELLOW}━━━ /dev/${dev} ━━━${NC}" fi
echo -e " ${GREEN}Critical Warning:${NC} ${cw:-N/A}" ;;
echo -e " ${GREEN}Temperature:${NC} ${temp:-N/A}"
echo -e " ${GREEN}Percentage Used:${NC} ${pu:-N/A}"
echo ""
done
_pause
fi
;;
*)
if ! is_installed "$pkg"; then
_run_install "$pkg"
else
echo "$pkg already installed."
fi
;;
esac esac
done done
echo -e "${GREEN}System tools installed.${NC}" echo -e "${GREEN}System tools installed.${NC}"
_pause _pause
} }
+51 -41
View File
@@ -17,7 +17,7 @@ _detect_all_network_devices() {
PCI_NET_DEVS=() PCI_NET_DEVS=()
while IFS= read -r line; do while IFS= read -r line; do
PCI_NET_DEVS+=("$line") PCI_NET_DEVS+=("$line")
done < <(timeout 2 lspci -nn 2>/dev/null | grep -iE 'network controller|ethernet controller' || true) done < <(echo "$LSPCI_OUTPUT" | grep -iE 'network controller|ethernet controller' || true)
USB_WIFI_DEVS=() USB_WIFI_DEVS=()
while IFS= read -r line; do while IFS= read -r line; do
@@ -29,7 +29,7 @@ _detect_all_network_devices() {
PCI_BT_DEVS=() PCI_BT_DEVS=()
while IFS= read -r line; do while IFS= read -r line; do
PCI_BT_DEVS+=("$line") PCI_BT_DEVS+=("$line")
done < <(timeout 2 lspci -nn 2>/dev/null | grep -i 'Bluetooth controller' || true) done < <(echo "$LSPCI_OUTPUT" | grep -i 'Bluetooth controller' || true)
USB_BT_DEVS=() USB_BT_DEVS=()
while IFS= read -r line; do while IFS= read -r line; do
@@ -86,16 +86,16 @@ _detect_firmware_needs() {
[[ "$vendor_lc" != *intel* && "$vendor_lc" != *realtek* && "$vendor_lc" != *atheros* && "$vendor_lc" != *qualcomm* && "$vendor_lc" != *mediatek* ]] && continue [[ "$vendor_lc" != *intel* && "$vendor_lc" != *realtek* && "$vendor_lc" != *atheros* && "$vendor_lc" != *qualcomm* && "$vendor_lc" != *mediatek* ]] && continue
case "$vendor_lc" in case "$vendor_lc" in
*intel*) *intel*)
if echo "$dev" | grep -qiE 'wireless|wi-fi|wlan|802\.11'; then if echo "$dev" | grep -qiE 'wireless|wi-fi|wlan|802\.11'; then
pkg="firmware-iwlwifi" pkg="firmware-iwlwifi"
else else
pkg="firmware-intel-misc" pkg="firmware-intel-misc"
fi fi
;; ;;
*realtek*) pkg="firmware-realtek" ;; *realtek*) pkg="firmware-realtek" ;;
*atheros*|*qualcomm*) pkg="firmware-atheros" ;; *atheros* | *qualcomm*) pkg="firmware-atheros" ;;
*mediatek*) pkg="firmware-mediatek" ;; *mediatek*) pkg="firmware-mediatek" ;;
esac esac
local short_dev local short_dev
@@ -153,7 +153,8 @@ _build_firmware_plan() {
if ! $has_bt; then if ! $has_bt; then
for dev in "${USB_WIFI_DEVS[@]}"; do for dev in "${USB_WIFI_DEVS[@]}"; do
if echo "$dev" | grep -qi 'bluetooth'; then if echo "$dev" | grep -qi 'bluetooth'; then
has_bt=true; break has_bt=true
break
fi fi
done done
fi fi
@@ -166,13 +167,14 @@ _build_firmware_plan() {
plan+=" [+] bluez + bluez-tools + bluez-obexd (base stack)\n" plan+=" [+] bluez + bluez-tools + bluez-obexd (base stack)\n"
fi fi
case "${DESKTOP_ENV:-other}" in case "${DESKTOP_ENV:-other}" in
kde) plan+=" [+] bluedevil (KDE applet)\n" kde)
if [ "${AUDIO_SERVER:-}" = "pipewire" ]; then plan+=" [+] bluedevil (KDE applet)\n"
plan+="pipewire-pulse + wireplumber (if missing)\n" if [ "${AUDIO_SERVER:-}" = "pipewire" ]; then
fi plan+=" → pipewire-pulse + wireplumber (if missing)\n"
;; fi
gnome) plan+=" (already in gnome-control-center)\n" ;; ;;
*) plan+=" [+] blueman (GTK Bluetooth manager)\n" ;; gnome) plan+=" (already in gnome-control-center)\n" ;;
*) plan+=" [+] blueman (GTK Bluetooth manager)\n" ;;
esac esac
plan+=" → Bluetooth service will be enabled\n" plan+=" → Bluetooth service will be enabled\n"
else else
@@ -224,25 +226,35 @@ _handle_wireless() {
[ -z "$bcm_id" ] && continue [ -z "$bcm_id" ] && continue
dev_id=$(echo "$bcm_id" | cut -d: -f2 | tr '[:upper:]' '[:lower:]') dev_id=$(echo "$bcm_id" | cut -d: -f2 | tr '[:upper:]' '[:lower:]')
# --- Verificación de headers --- # --- Dependencies verification ---
if ! apt-cache policy linux-headers-amd64 2>/dev/null | grep -q "Candidate: [^ (none)]"; then if ! is_installed "linux-headers-amd64" || ! is_installed "dkms"; then
_msg "Broadcom Error" "linux-headers-amd64 is not available. Cannot compile Broadcom driver.\n\nEnsure non-free repositories are enabled and run:\n sudo apt install linux-headers-amd64" if ! apt-cache show linux-headers-amd64 dkms >/dev/null 2>&1; then
_pause _msg "Broadcom Error" "linux-headers-amd64 or dkms are not available in your repositories. Cannot compile Broadcom driver.\n\nEnsure repositories are enabled and run:\n sudo apt install linux-headers-amd64 dkms"
_pause
continue
fi
fi
# --- Confirmation ---
if ! _confirm "Broadcom WiFi" "Detected Broadcom wireless device.\n\nInstall broadcom-sta-dkms, dkms, and wireless-tools?"; then
continue continue
fi fi
# --- Confirmación --- # --- Step-by-step installation ---
local bcm_ver header_ver _run_cmd "Broadcom Deps" "sudo DEBIAN_FRONTEND=noninteractive apt install -y dkms wireless-tools linux-headers-amd64" || true
bcm_ver=$(apt-cache policy broadcom-sta-dkms 2>/dev/null | awk 'NR==3 {print $2}') _run_cmd "Broadcom Driver" "sudo DEBIAN_FRONTEND=noninteractive apt install -y broadcom-sta-dkms" || true
header_ver=$(apt-cache policy linux-headers-amd64 2>/dev/null | awk 'NR==3 {print $2}')
if ! _confirm "Broadcom WiFi" "Detected Broadcom wireless device.\n\nInstall broadcom-sta-dkms ${bcm_ver} + linux-headers-amd64 ${header_ver}?"; then
continue
fi
# --- Instalación --- # --- Persist blacklist of conflicting modules ---
_run_cmd "Broadcom" "sudo DEBIAN_FRONTEND=noninteractive apt install -y linux-headers-amd64 broadcom-sta-dkms" || true local blacklist_conf="/etc/modprobe.d/blacklist-broadcom.conf"
local blacklist_content="blacklist b43\nblacklist b43legacy\nblacklist brcmsmac\nblacklist bcma\nblacklist ssb"
echo -e "$blacklist_content" | sudo tee "$blacklist_conf" >/dev/null
# --- Combo BT (sin cambios respecto al código actual) --- # --- Update initramfs and load module ---
_run_cmd "Initramfs" "sudo update-initramfs -u" || true
_run_cmd "Modprobe" "sudo modprobe -r b43 b43legacy b44 bcma brcmsmac brcmfmac ssb wl 2>/dev/null || true" "Removing conflicting modules" || true
_run_cmd "Modprobe" "sudo modprobe wl" || true
# --- Combo BT (unchanged) ---
local has_broadcom_bt=false local has_broadcom_bt=false
local btdev local btdev
for btdev in "${PCI_BT_DEVS[@]}"; do for btdev in "${PCI_BT_DEVS[@]}"; do
@@ -258,13 +270,12 @@ _handle_wireless() {
echo -e "${YELLOW} A reboot may be required for Bluetooth support.${NC}" echo -e "${YELLOW} A reboot may be required for Bluetooth support.${NC}"
fi fi
# --- Post-DKMS verification (Fix 5, sin cambios) --- # --- Post-DKMS verification (Fix 5, unchanged) ---
if ! ls /lib/modules/$(uname -r)/updates/dkms/wl.ko* 2>/dev/null | grep -q .; then if ! ls /lib/modules/$(uname -r)/updates/dkms/wl.ko* 2>/dev/null | grep -q .; then
_msg "Broadcom DKMS Build Failed" "The wl module was not built by DKMS.\n\nPossible causes:\n- Missing build tools (build-essential, dkms)\n- Kernel update without headers\n- Incompatible kernel version\n\nTry: sudo dpkg-reconfigure broadcom-sta-dkms" _msg "Broadcom DKMS Build Failed" "The wl module was not built by DKMS.\n\nPossible causes:\n- Missing build tools (build-essential, dkms)\n- Kernel update without headers\n- Incompatible kernel version\n\nTry: sudo dpkg-reconfigure broadcom-sta-dkms"
if _confirm "Broadcom" "Rebuild the Broadcom driver now?"; then if _confirm "Broadcom" "Rebuild the Broadcom driver now?"; then
_run_cmd "Broadcom" "sudo dpkg-reconfigure broadcom-sta-dkms" || true _run_cmd "Broadcom" "sudo dpkg-reconfigure broadcom-sta-dkms" || true
if ls /lib/modules/$(uname -r)/updates/dkms/wl.ko* 2>/dev/null | grep -q .; then if ls /lib/modules/$(uname -r)/updates/dkms/wl.ko* 2>/dev/null | grep -q .; then
# wl.ko existe tras reconfigure → continuar a limpieza/carga
: :
else else
local dmesg_out local dmesg_out
@@ -280,7 +291,6 @@ _handle_wireless() {
fi fi
fi fi
# --- Limpieza de módulos conflictivos + carga wl (patrón Mint) ---
sudo modprobe -r b43 b43legacy b44 bcma brcmsmac brcmfmac ssb wl 2>/dev/null || true sudo modprobe -r b43 b43legacy b44 bcma brcmsmac brcmfmac ssb wl 2>/dev/null || true
sudo modprobe wl 2>/dev/null sudo modprobe wl 2>/dev/null
@@ -297,7 +307,7 @@ _handle_wireless() {
fi fi
done done
# --- USB Broadcom (sin cambios) --- # --- USB Broadcom (unchanged) ---
local usb_dev local usb_dev
for usb_dev in "${USB_WIFI_DEVS[@]}"; do for usb_dev in "${USB_WIFI_DEVS[@]}"; do
if echo "$usb_dev" | grep -qi '0a5c'; then if echo "$usb_dev" | grep -qi '0a5c'; then
@@ -306,7 +316,7 @@ _handle_wireless() {
fi fi
done done
# --- Mensaje final (sin cambios) --- # --- Mensaje final (unchanged) ---
if ! $installed_any && ! $wl_build_failed; then if ! $installed_any && ! $wl_build_failed; 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 _pause
@@ -387,7 +397,7 @@ _ensure_nonfree_repo() {
return 1 return 1
fi fi
sudo apt update _ensure_apt_updated
echo -e "${GREEN}non-free repository enabled.${NC}" echo -e "${GREEN}non-free repository enabled.${NC}"
return 0 return 0
} }
@@ -419,7 +429,7 @@ install_firmware() {
# 4. Install base firmware meta-package (unchanged logic) # 4. Install base firmware meta-package (unchanged logic)
local fw_pkg="firmware-linux-nonfree" local fw_pkg="firmware-linux-nonfree"
local fw_bpo local fw_bpo
fw_bpo=$(apt-cache madison "$fw_pkg" 2>/dev/null | \ fw_bpo=$(apt-cache madison "$fw_pkg" 2>/dev/null |
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
local fw_stable local fw_stable
+31 -31
View File
@@ -60,7 +60,7 @@ ensure_contrib_repo() {
return 1 return 1
fi fi
sudo apt update _ensure_apt_updated
echo -e "${GREEN}contrib repository enabled.${NC}" echo -e "${GREEN}contrib repository enabled.${NC}"
return 0 return 0
} }
@@ -72,15 +72,15 @@ install_gaming() {
local choices local choices
choices=$(_checklist "Gaming Setup" \ choices=$(_checklist "Gaming Setup" \
"Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"i386" "Enable 32-bit (i386) architecture" ON \ "i386" "Enable 32-bit (i386) architecture" ON \
"steam" "Steam (requires 32-bit support)" ON \ "steam" "Steam (requires 32-bit support)" ON \
"mangohud" "Performance overlay (Vulkan/OpenGL)" ON \ "mangohud" "Performance overlay (Vulkan/OpenGL)" ON \
"gamemode" "Game performance optimization" OFF \ "gamemode" "Game performance optimization" OFF \
"goverlay" "MangoHud config GUI" ON \ "goverlay" "MangoHud config GUI" ON \
"heroic" "Heroic Launcher (Epic/GOG)" OFF \ "heroic" "Heroic Launcher (Epic/GOG)" OFF \
"java" "Minecraft Java Runtime" OFF \ "java" "Minecraft Java Runtime" OFF \
"openrgb" "OpenRGB (RGB lighting control)" OFF \ "openrgb" "OpenRGB (RGB lighting control)" OFF \
"lutris" "Lutris + Wine (requires 32-bit support)" OFF \ "lutris" "Lutris + Wine (requires 32-bit support)" OFF \
"retroarch" "RetroArch Emulator Frontend" OFF) "retroarch" "RetroArch Emulator Frontend" OFF)
if [ -z "$choices" ]; then if [ -z "$choices" ]; then
@@ -95,7 +95,7 @@ install_gaming() {
# 2. Determine if 32-bit is needed (steam, lutris, or explicit i386 toggle) # 2. Determine if 32-bit is needed (steam, lutris, or explicit i386 toggle)
local need_32bit=false local need_32bit=false
for p in $cleaned; do for p in $cleaned; do
case $p in steam|lutris) need_32bit=true ;; esac case $p in steam | lutris) need_32bit=true ;; esac
done done
echo "$cleaned" | grep -qw i386 && need_32bit=true echo "$cleaned" | grep -qw i386 && need_32bit=true
@@ -108,7 +108,7 @@ install_gaming() {
if $need_32bit && ! dpkg --print-foreign-architectures 2>/dev/null | grep -q i386; then if $need_32bit && ! dpkg --print-foreign-architectures 2>/dev/null | grep -q i386; then
echo -e "${YELLOW}Enabling i386 architecture (required by selection)...${NC}" echo -e "${YELLOW}Enabling i386 architecture (required by selection)...${NC}"
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
_run_cmd "APT Update" "sudo apt update" "Updating package lists..." _ensure_apt_updated
fi fi
# 4. Install 32-bit graphics drivers only if 32-bit is needed # 4. Install 32-bit graphics drivers only if 32-bit is needed
@@ -124,28 +124,28 @@ install_gaming() {
# 5. Install selected packages # 5. Install selected packages
for pkg in $install_list; do for pkg in $install_list; do
case $pkg in case $pkg in
steam) steam)
if ensure_contrib_repo; then if ensure_contrib_repo; then
install_steam install_steam
else else
echo -e "${YELLOW}Skipping Steam installation (contrib repository not enabled).${NC}" echo -e "${YELLOW}Skipping Steam installation (contrib repository not enabled).${NC}"
fi fi
;; ;;
heroic) install_heroic ;; heroic) install_heroic ;;
java) install_minecraft_java ;; java) install_minecraft_java ;;
mangohud) install_mangohud ;; mangohud) install_mangohud ;;
gamemode) install_gamemode ;; gamemode) install_gamemode ;;
goverlay) install_goverlay ;; goverlay) install_goverlay ;;
openrgb) openrgb)
if [ "$DEBIAN_VERSION" = "11" ]; then if [ "$DEBIAN_VERSION" = "11" ]; then
echo "OpenRGB requires Debian 12+." echo "OpenRGB requires Debian 12+."
continue continue
fi fi
install_openrgb install_openrgb
;; ;;
lutris) install_lutris ;; lutris) install_lutris ;;
retroarch) install_retroarch ;; retroarch) install_retroarch ;;
*) _run_install "$pkg" ;; *) _run_install "$pkg" ;;
esac esac
done done
+85 -81
View File
@@ -19,8 +19,8 @@ _warn_nvidia_gnome_wayland() {
command -v gdm3 &>/dev/null || return 0 command -v gdm3 &>/dev/null || return 0
gnome-shell --version 2>/dev/null | grep -qi "shell 4[0-9]" || return 0 gnome-shell --version 2>/dev/null | grep -qi "shell 4[0-9]" || return 0
case "$NVIDIA_DRIVER_MODE" in case "$NVIDIA_DRIVER_MODE" in
stable|backports|cuda-repo|extrepo) ;; stable | backports | cuda-repo | extrepo) ;;
*) return 0 ;; *) return 0 ;;
esac esac
echo -e "${YELLOW}WARNING: Debian bug #1109409 may affect GDM3 + NVIDIA + Wayland.${NC}" echo -e "${YELLOW}WARNING: Debian bug #1109409 may affect GDM3 + NVIDIA + Wayland.${NC}"
echo -e "${YELLOW}If you see a black screen after reboot, select 'GNOME on Xorg' at login.${NC}" echo -e "${YELLOW}If you see a black screen after reboot, select 'GNOME on Xorg' at login.${NC}"
@@ -33,7 +33,7 @@ _install_amd_intel_stack() {
local ref_ver local ref_ver
ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}') ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}')
local ref_bpo_ver local ref_bpo_ver
ref_bpo_ver=$(apt-cache madison mesa-vulkan-drivers 2>/dev/null | \ ref_bpo_ver=$(apt-cache madison mesa-vulkan-drivers 2>/dev/null |
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
local comp_line="Components: Vulkan, OpenGL, GLX, EGL, VA-API (64-bit)" local comp_line="Components: Vulkan, OpenGL, GLX, EGL, VA-API (64-bit)"
@@ -79,11 +79,13 @@ _install_amd_intel_stack() {
local desc local desc
desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//') desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//')
plan+=" GPU ${gpu_count}: ${desc}\n" plan+=" GPU ${gpu_count}: ${desc}\n"
done < <(timeout 2 lspci -nn | grep -E "VGA|3D" || true) done < <(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D" || true)
plan+="\nPlanned components:\n" plan+="\nPlanned components:\n"
if $HAS_INTEL; then if $HAS_INTEL; then
local _gen; _gen=$(get_intel_generation) local _gen
local _va; [ "$_gen" = "gen7-" ] && _va="i965-va-driver-shaders" || _va="intel-media-va-driver-non-free" _gen=$(get_intel_generation)
local _va
[ "$_gen" = "gen7-" ] && _va="i965-va-driver-shaders" || _va="intel-media-va-driver-non-free"
plan+=" [+] Intel firmware + ${_va}\n" plan+=" [+] Intel firmware + ${_va}\n"
fi fi
if $HAS_AMD; then if $HAS_AMD; then
@@ -154,7 +156,9 @@ _apply_amd_gcn_grub_fix() {
sudo cp "$file" "$backup" sudo cp "$file" "$backup"
sudo sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$*/${params}&/" "$file" if ! sudo grep -q "amdgpu.si_support=1" "$file"; then
sudo sed -i -E "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"([^\"]*)\"/\"${params} \1\"/" "$file"
fi
if _confirm "AMD GCN — GRUB" "Parameters added:\n\n ${params}\n\nRun update-grub now?" 12 65; then if _confirm "AMD GCN — GRUB" "Parameters added:\n\n ${params}\n\nRun update-grub now?" 12 65; then
if sudo update-grub >/dev/null 2>&1; then if sudo update-grub >/dev/null 2>&1; then
@@ -183,7 +187,7 @@ _install_nvidia_stack() {
local desc local desc
desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//') desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//')
plan+=" GPU ${gpu_count}: ${desc}\n" plan+=" GPU ${gpu_count}: ${desc}\n"
done < <(timeout 2 lspci -nn | grep -E "VGA|3D" || true) done < <(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D" || true)
plan+="\nPlanned:\n [+] NVIDIA proprietary driver" plan+="\nPlanned:\n [+] NVIDIA proprietary driver"
_msg "NVIDIA Stack — Plan" "$plan" 14 65 _msg "NVIDIA Stack — Plan" "$plan" 14 65
@@ -213,94 +217,94 @@ _install_nvidia_stack() {
local nv_arch="" local nv_arch=""
case "$NVIDIA_SELECTED_VERSION" in case "$NVIDIA_SELECTED_VERSION" in
470) 470)
# Legacy 470 (Kepler/Tesla) — forced, regardless of auto-detection # Legacy 470 (Kepler/Tesla) — forced, regardless of auto-detection
_install_nvidia_bookworm_kepler
;;
535)
if [ "$(is_nvidia_kepler)" = "true" ]; then
_install_nvidia_bookworm_kepler _install_nvidia_bookworm_kepler
elif [ "$(is_nvidia_fermi)" = "true" ]; then
_msg "NVIDIA Fermi — Bookworm" \
"Fermi GPUs (GF1xx) are not supported\nin Debian 12 (Bookworm).\nThe nvidia-legacy-390xx driver is\nnot available in this version.\n\nNo NVIDIA driver will be installed."
NVIDIA_DRIVER_MODE=""
else
_install_nvidia_standard
fi
;;
550)
nv_arch=$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")
case "$nv_arch" in
legacy)
_msg "NVIDIA — Trixie" \
"Kepler and Fermi GPUs are not supported\nin Debian 13 (Trixie).\n\nThe nvidia-legacy drivers are not available\nin this version of Debian.\n\nNo NVIDIA driver will be installed."
NVIDIA_DRIVER_MODE=""
;; ;;
535) blackwell)
if [ "$(is_nvidia_kepler)" = "true" ]; then _msg "NVIDIA — Blackwell (v550)" \
_install_nvidia_bookworm_kepler "Your Blackwell GPU is NOT supported by the official\nDebian v550 driver.\n\nPlease select v590 or v595 (NVIDIA CUDA Repo)\nin the driver menu." 14 65
elif [ "$(is_nvidia_fermi)" = "true" ]; then NVIDIA_DRIVER_MODE=""
_msg "NVIDIA Fermi — Bookworm" \
"Fermi GPUs (GF1xx) are not supported\nin Debian 12 (Bookworm).\nThe nvidia-legacy-390xx driver is\nnot available in this version.\n\nNo NVIDIA driver will be installed."
NVIDIA_DRIVER_MODE=""
else
_install_nvidia_standard
fi
;; ;;
550) maxwell | pascal | volta)
nv_arch=$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID") if [ "$(is_backports_kernel)" = "true" ]; then
case "$nv_arch" in local gpu_gen="Maxwell"
legacy) [ "$nv_arch" = "pascal" ] && gpu_gen="Pascal"
_msg "NVIDIA — Trixie" \ [ "$nv_arch" = "volta" ] && gpu_gen="Volta"
"Kepler and Fermi GPUs are not supported\nin Debian 13 (Trixie).\n\nThe nvidia-legacy drivers are not available\nin this version of Debian.\n\nNo NVIDIA driver will be installed." _msg "NVIDIA — Trixie + Backports" \
NVIDIA_DRIVER_MODE="" "INCOMPATIBILITY DETECTED: Your NVIDIA ${gpu_gen} GPU\n\
;;
blackwell)
_msg "NVIDIA — Blackwell (v550)" \
"Your Blackwell GPU is NOT supported by the official\nDebian v550 driver.\n\nPlease select v590 or v595 (NVIDIA CUDA Repo)\nin the driver menu." 14 65
NVIDIA_DRIVER_MODE=""
;;
maxwell|pascal|volta)
if [ "$(is_backports_kernel)" = "true" ]; then
local gpu_gen="Maxwell"
[ "$nv_arch" = "pascal" ] && gpu_gen="Pascal"
[ "$nv_arch" = "volta" ] && gpu_gen="Volta"
_msg "NVIDIA — Trixie + Backports" \
"INCOMPATIBILITY DETECTED: Your NVIDIA ${gpu_gen} GPU\n\
is NOT supported by the modern v590 driver.\n\n\ is NOT supported by the modern v590 driver.\n\n\
To run NVIDIA safely on Debian 13 (Trixie), you MUST use\n\ To run NVIDIA safely on Debian 13 (Trixie), you MUST use\n\
the official Debian v550 driver, which requires the\n\ the official Debian v550 driver, which requires the\n\
standard STABLE Kernel.\n\n\ standard STABLE Kernel.\n\n\
Forcing the stable driver path." 14 70 Forcing the stable driver path." 14 70
if ! _install_nvidia_standard; then if ! _install_nvidia_standard; then
NVIDIA_DRIVER_MODE=""
return 1
fi
NVIDIA_DRIVER_MODE="stable"
else
_install_nvidia_standard
fi
;;
turing|ampere|ada)
_install_nvidia_standard
;;
*)
if [ "$(is_backports_kernel)" = "true" ]; then
_install_nvidia_cuda_repo
else
_install_nvidia_standard
fi
;;
esac
;;
590|595)
nv_arch=$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")
if [ "$nv_arch" = "maxwell" ] || [ "$nv_arch" = "pascal" ] || [ "$nv_arch" = "legacy" ]; then
local gpu_gen="Kepler/Fermi"
[ "$nv_arch" = "maxwell" ] && gpu_gen="Maxwell"
[ "$nv_arch" = "pascal" ] && gpu_gen="Pascal"
_msg "NVIDIA — v${NVIDIA_SELECTED_VERSION}" \
"Your NVIDIA ${gpu_gen} GPU is NOT supported by\nNVIDIA driver v${NVIDIA_SELECTED_VERSION}.\n\n\
Only Turing, Ampere, Ada and Blackwell GPUs are supported.\n\n\
No NVIDIA driver will be installed." 14 65
NVIDIA_DRIVER_MODE=""
else
if ! _enable_cuda_repo; then
NVIDIA_DRIVER_MODE="" NVIDIA_DRIVER_MODE=""
_msg "CUDA Repo — Error" "Failed to enable the official NVIDIA CUDA repository.\n\nNo NVIDIA driver was installed." 10 60
return 1 return 1
fi fi
if _install_nvidia_cuda_repo "$NVIDIA_SELECTED_VERSION"; then NVIDIA_DRIVER_MODE="stable"
NVIDIA_DRIVER_MODE="cuda-repo" else
else _install_nvidia_standard
NVIDIA_DRIVER_MODE=""
fi
fi fi
;; ;;
*) turing | ampere | ada)
_install_nvidia_standard _install_nvidia_standard
;; ;;
*)
if [ "$(is_backports_kernel)" = "true" ]; then
_install_nvidia_cuda_repo
else
_install_nvidia_standard
fi
;;
esac
;;
590 | 595)
nv_arch=$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")
if [ "$nv_arch" = "maxwell" ] || [ "$nv_arch" = "pascal" ] || [ "$nv_arch" = "legacy" ]; then
local gpu_gen="Kepler/Fermi"
[ "$nv_arch" = "maxwell" ] && gpu_gen="Maxwell"
[ "$nv_arch" = "pascal" ] && gpu_gen="Pascal"
_msg "NVIDIA — v${NVIDIA_SELECTED_VERSION}" \
"Your NVIDIA ${gpu_gen} GPU is NOT supported by\nNVIDIA driver v${NVIDIA_SELECTED_VERSION}.\n\n\
Only Turing, Ampere, Ada and Blackwell GPUs are supported.\n\n\
No NVIDIA driver will be installed." 14 65
NVIDIA_DRIVER_MODE=""
else
if ! _enable_cuda_repo; then
NVIDIA_DRIVER_MODE=""
_msg "CUDA Repo — Error" "Failed to enable the official NVIDIA CUDA repository.\n\nNo NVIDIA driver was installed." 10 60
return 1
fi
if _install_nvidia_cuda_repo "$NVIDIA_SELECTED_VERSION"; then
NVIDIA_DRIVER_MODE="cuda-repo"
else
NVIDIA_DRIVER_MODE=""
fi
fi
;;
*)
_install_nvidia_standard
;;
esac esac
fi fi
+26 -20
View File
@@ -3,7 +3,7 @@
declare -A NVIDIA_FAMILY_MAP=( declare -A NVIDIA_FAMILY_MAP=(
# Fermi / Kepler (Legacy: el shim se encarga de separarlos) # Fermi / Kepler (Legacy: el shim se encarga de separarlos)
["06"]="legacy" ["0D"]="legacy" ["0E"]="legacy" ["06"]="legacy" ["0D"]="legacy" ["0E"]="legacy"
["0F"]="legacy" ["10"]="legacy" ["11"]="legacy" ["12"]="legacy" ["0F"]="legacy" ["10"]="legacy" ["11"]="legacy" ["12"]="legacy"
# Maxwell # Maxwell
["13"]="maxwell" ["14"]="maxwell" ["16"]="maxwell" ["17"]="maxwell" ["13"]="maxwell" ["14"]="maxwell" ["16"]="maxwell" ["17"]="maxwell"
@@ -18,12 +18,15 @@ declare -A NVIDIA_FAMILY_MAP=(
# Ada Lovelace # Ada Lovelace
["26"]="ada" ["27"]="ada" ["28"]="ada" ["26"]="ada" ["27"]="ada" ["28"]="ada"
# Blackwell # Blackwell
["29"]="blackwell" ["2B"]="blackwell" ["2C"]="blackwell" ["29"]="blackwell" ["2B"]="blackwell" ["2C"]="blackwell"
["2D"]="blackwell" ["2E"]="blackwell" ["31"]="blackwell" ["2D"]="blackwell" ["2E"]="blackwell" ["31"]="blackwell"
) )
detect_nvidia_arch() { detect_nvidia_arch() {
[ -z "$1" ] && { echo "unknown"; return; } [ -z "$1" ] && {
echo "unknown"
return
}
local pci_id="${1^^}" local pci_id="${1^^}"
local prefix="${pci_id:0:2}" local prefix="${pci_id:0:2}"
echo "${NVIDIA_FAMILY_MAP[$prefix]:-unknown}" echo "${NVIDIA_FAMILY_MAP[$prefix]:-unknown}"
@@ -56,21 +59,24 @@ _get_nvidia_arch_family() {
fi fi
} }
is_nvidia_kepler() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "legacy" ]] && _is_nvidia_kepler_id "$NVIDIA_GPU_DEVICE_ID" && echo true || echo false; } is_nvidia_kepler() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "legacy" ]] && _is_nvidia_kepler_id "$NVIDIA_GPU_DEVICE_ID" && echo true || echo false; }
is_nvidia_fermi() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "legacy" ]] && ! _is_nvidia_kepler_id "$NVIDIA_GPU_DEVICE_ID" && echo true || echo false; } is_nvidia_fermi() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "legacy" ]] && ! _is_nvidia_kepler_id "$NVIDIA_GPU_DEVICE_ID" && echo true || echo false; }
is_nvidia_legacy() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "legacy" ]] && echo true || echo false; } is_nvidia_legacy() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "legacy" ]] && echo true || echo false; }
is_nvidia_maxwell() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "maxwell" ]] && echo true || echo false; } is_nvidia_maxwell() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "maxwell" ]] && echo true || echo false; }
is_nvidia_pascal() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "pascal" ]] && echo true || echo false; } is_nvidia_pascal() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "pascal" ]] && echo true || echo false; }
is_nvidia_volta() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "volta" ]] && echo true || echo false; } is_nvidia_volta() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "volta" ]] && echo true || echo false; }
is_nvidia_turing() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "turing" ]] && echo true || echo false; } is_nvidia_turing() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "turing" ]] && echo true || echo false; }
is_nvidia_ampere() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "ampere" ]] && echo true || echo false; } is_nvidia_ampere() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "ampere" ]] && echo true || echo false; }
is_nvidia_ada() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "ada" ]] && echo true || echo false; } is_nvidia_ada() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "ada" ]] && echo true || echo false; }
is_nvidia_blackwell(){ [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "blackwell" ]] && echo true || echo false; } is_nvidia_blackwell() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "blackwell" ]] && echo true || echo false; }
is_amd_legacy_gcn() { is_amd_legacy_gcn() {
local dev_id local dev_id
dev_id=$(timeout 2 lspci -nn | grep -iE "VGA|3D" | grep -i amd | grep -oP '1002:\K[0-9a-fA-F]{4}' | head -n1) dev_id=$(echo "$LSPCI_OUTPUT" | grep -iE "VGA|3D" | grep -i amd | grep -oP '1002:\K[0-9a-fA-F]{4}' | head -n1)
[ -z "$dev_id" ] && { echo false; return; } [ -z "$dev_id" ] && {
echo false
return
}
local legacy_ids local legacy_ids
legacy_ids="6660|6664|6665|6667|6780|6784|6788|678a|6798|679a|679e|679f|3000|3001|6808|6809|6810|6811|6816|6817|6818|6819|6828|6829|682b|682c|6835|6837|683d|683f|6608|6609|6610|6611|6613|6617|1dcf|983d|6646|6649|664d|6650|6651|6658|665c|665d|67a0|67a1|67a2|67a8|67a9|67aa|67b0|67b1|67b8|67be|9830|9831|9832|9833|9834|9835|9836|9837|9838|9839|1304|1305|1306|1307|1309|130a|130b|130c|130d|130e|130f|1310|1311|1312|1313|1315|1316|1317|1318|131b|131c|131d|9850|9851|9852|9853|9854|9855|9856|9857|9858|9859|985a|985b|985c|985d|985e|985f" legacy_ids="6660|6664|6665|6667|6780|6784|6788|678a|6798|679a|679e|679f|3000|3001|6808|6809|6810|6811|6816|6817|6818|6819|6828|6829|682b|682c|6835|6837|683d|683f|6608|6609|6610|6611|6613|6617|1dcf|983d|6646|6649|664d|6650|6651|6658|665c|665d|67a0|67a1|67a2|67a8|67a9|67aa|67b0|67b1|67b8|67be|9830|9831|9832|9833|9834|9835|9836|9837|9838|9839|1304|1305|1306|1307|1309|130a|130b|130c|130d|130e|130f|1310|1311|1312|1313|1315|1316|1317|1318|131b|131c|131d|9850|9851|9852|9853|9854|9855|9856|9857|9858|9859|985a|985b|985c|985d|985e|985f"
@@ -94,7 +100,7 @@ _install_mesa_backports() {
for mpkg in "${mesa_pkgs[@]}"; do for mpkg in "${mesa_pkgs[@]}"; do
local bpo_ver local bpo_ver
bpo_ver=$(apt-cache madison "$mpkg" 2>/dev/null | \ bpo_ver=$(apt-cache madison "$mpkg" 2>/dev/null |
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
if [ -n "$bpo_ver" ]; then if [ -n "$bpo_ver" ]; then
bpo_pkgs+=("$mpkg") bpo_pkgs+=("$mpkg")
@@ -114,7 +120,7 @@ _install_mesa_backports() {
local ref_ver local ref_ver
ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}') ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}')
local ref_bpo_ver local ref_bpo_ver
ref_bpo_ver=$(apt-cache madison mesa-vulkan-drivers 2>/dev/null | \ ref_bpo_ver=$(apt-cache madison mesa-vulkan-drivers 2>/dev/null |
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
local comp_line="Components: Vulkan, OpenGL, GLX, EGL, VA-API (64-bit)" local comp_line="Components: Vulkan, OpenGL, GLX, EGL, VA-API (64-bit)"
@@ -176,17 +182,17 @@ offer_generic_tools() {
_is_hybrid_laptop() { _is_hybrid_laptop() {
local gpu_count nvidia_count chassis local gpu_count nvidia_count chassis
gpu_count=$(lspci -nn 2>/dev/null | grep -ciE "VGA compatible|3D controller") || true gpu_count=$(echo "$LSPCI_OUTPUT" | grep -ciE "VGA compatible|3D controller") || true
[ "$gpu_count" -lt 2 ] && return 1 [ "$gpu_count" -lt 2 ] && return 1
# Defensa en profundidad: si TODAS las GPUs son NVIDIA (SLI o # Defensa en profundidad: si TODAS las GPUs son NVIDIA (SLI o
# dual-GPU desktop), no hay iGPU Intel/AMD → no es híbrida. # dual-GPU desktop), no hay iGPU Intel/AMD → no es híbrida.
nvidia_count=$(lspci -nn 2>/dev/null | grep -iE "VGA compatible|3D controller" | grep -c "10de:") || true nvidia_count=$(echo "$LSPCI_OUTPUT" | grep -iE "VGA compatible|3D controller" | grep -c "10de:") || true
[ "$nvidia_count" -ge "$gpu_count" ] && return 1 [ "$nvidia_count" -ge "$gpu_count" ] && return 1
chassis=$(cat /sys/class/dmi/id/chassis_type 2>/dev/null || echo "0") chassis=$(cat /sys/class/dmi/id/chassis_type 2>/dev/null || echo "0")
case "$chassis" in case "$chassis" in
8|9|10|11|14|30|31|32) return 0 ;; 8 | 9 | 10 | 11 | 14 | 30 | 31 | 32) return 0 ;;
esac esac
ls /sys/class/power_supply/ 2>/dev/null | grep -q "^BAT" && return 0 ls /sys/class/power_supply/ 2>/dev/null | grep -q "^BAT" && return 0
+31 -28
View File
@@ -8,7 +8,7 @@ REPO_BACKUP_DIR=""
backup_current_repos() { backup_current_repos() {
REPO_BACKUP_DIR=$(mktemp -d) REPO_BACKUP_DIR=$(mktemp -d)
for f in /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources \ for f in /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources \
/etc/apt/sources.list.d/debian-backports.list /etc/apt/sources.list.d/debian-backports.sources; do /etc/apt/sources.list.d/debian-backports.list /etc/apt/sources.list.d/debian-backports.sources; do
if [ -f "$f" ]; then if [ -f "$f" ]; then
mkdir -p "$REPO_BACKUP_DIR/$(dirname "${f#/etc/apt/}")" mkdir -p "$REPO_BACKUP_DIR/$(dirname "${f#/etc/apt/}")"
cp "$f" "$REPO_BACKUP_DIR/$(dirname "${f#/etc/apt/}")/$(basename "$f")" cp "$f" "$REPO_BACKUP_DIR/$(dirname "${f#/etc/apt/}")/$(basename "$f")"
@@ -23,7 +23,7 @@ restore_previous_repos() {
echo -e "${RED}Restoring previous repository configuration...${NC}" echo -e "${RED}Restoring previous repository configuration...${NC}"
local found=false local found=false
for f in /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources \ for f in /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources \
/etc/apt/sources.list.d/debian-backports.list /etc/apt/sources.list.d/debian-backports.sources; do /etc/apt/sources.list.d/debian-backports.list /etc/apt/sources.list.d/debian-backports.sources; do
local rel="${f#/etc/apt/}" local rel="${f#/etc/apt/}"
local backup_file="$REPO_BACKUP_DIR/$rel" local backup_file="$REPO_BACKUP_DIR/$rel"
if [ -f "$backup_file" ]; then if [ -f "$backup_file" ]; then
@@ -103,7 +103,7 @@ _write_deb822() {
if content_differs "$main_file" "$main_content"; then if content_differs "$main_file" "$main_content"; then
if _confirm "Deb822 Sources" "Write main deb822 configuration to ${main_file}?"; then if _confirm "Deb822 Sources" "Write main deb822 configuration to ${main_file}?"; then
sudo mkdir -p /etc/apt/sources.list.d sudo mkdir -p /etc/apt/sources.list.d
echo -e "$main_content" | sudo tee "$main_file" > /dev/null echo -e "$main_content" | sudo tee "$main_file" >/dev/null
echo "Wrote ${main_file}" echo "Wrote ${main_file}"
else else
echo "Main repository configuration skipped." echo "Main repository configuration skipped."
@@ -146,7 +146,7 @@ _write_deb822_backports() {
if content_differs "$bp_file" "$bp_content"; then if content_differs "$bp_file" "$bp_content"; then
if _confirm "Deb822 Backports" "Write backports to ${bp_file}?"; then if _confirm "Deb822 Backports" "Write backports to ${bp_file}?"; then
sudo mkdir -p /etc/apt/sources.list.d sudo mkdir -p /etc/apt/sources.list.d
echo -e "$bp_content" | sudo tee "$bp_file" > /dev/null echo -e "$bp_content" | sudo tee "$bp_file" >/dev/null
echo "Wrote ${bp_file}" echo "Wrote ${bp_file}"
else else
return 1 return 1
@@ -154,7 +154,7 @@ _write_deb822_backports() {
fi fi
# If backports were formerly embedded in debian.sources, clean them # If backports were formerly embedded in debian.sources, clean them
grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null && \ grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null &&
_clean_embedded_backports_deb822 "$codename" || true _clean_embedded_backports_deb822 "$codename" || true
} }
@@ -172,7 +172,7 @@ _remove_deb822_backports() {
fi fi
# Also clean any embedded backports in main debian.sources # Also clean any embedded backports in main debian.sources
grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null && \ grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null &&
_clean_embedded_backports_deb822 "$codename" _clean_embedded_backports_deb822 "$codename"
# Clean embedded backports from classic file too (safety net) # Clean embedded backports from classic file too (safety net)
@@ -199,7 +199,7 @@ _write_classic() {
if content_differs "$main_file" "$main_content"; then if content_differs "$main_file" "$main_content"; then
if _confirm "Classic Sources" "Write main classic configuration to ${main_file}?"; then if _confirm "Classic Sources" "Write main classic configuration to ${main_file}?"; then
echo -e "$main_content" | sudo tee "$main_file" > /dev/null echo -e "$main_content" | sudo tee "$main_file" >/dev/null
echo "Wrote ${main_file}" echo "Wrote ${main_file}"
else else
echo "Main repository configuration skipped." echo "Main repository configuration skipped."
@@ -240,7 +240,7 @@ _write_classic_backports() {
if content_differs "$bp_file" "$bp_content"; then if content_differs "$bp_file" "$bp_content"; then
if _confirm "Classic Backports" "Write backports to ${bp_file}?"; then if _confirm "Classic Backports" "Write backports to ${bp_file}?"; then
sudo mkdir -p /etc/apt/sources.list.d sudo mkdir -p /etc/apt/sources.list.d
echo -e "$bp_content" | sudo tee "$bp_file" > /dev/null echo -e "$bp_content" | sudo tee "$bp_file" >/dev/null
echo "Wrote ${bp_file}" echo "Wrote ${bp_file}"
else else
return 1 return 1
@@ -248,7 +248,7 @@ _write_classic_backports() {
fi fi
# If backports were formerly embedded in sources.list, clean them # If backports were formerly embedded in sources.list, clean them
grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null && \ grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null &&
_clean_embedded_backports_classic "$codename" || true _clean_embedded_backports_classic "$codename" || true
} }
@@ -266,7 +266,7 @@ _remove_classic_backports() {
fi fi
# Also clean any embedded backports in main sources.list # Also clean any embedded backports in main sources.list
grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null && \ grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null &&
_clean_embedded_backports_classic "$codename" _clean_embedded_backports_classic "$codename"
# Clean embedded backports from deb822 file too (safety net) # Clean embedded backports from deb822 file too (safety net)
@@ -309,17 +309,17 @@ configure_repos() {
clear clear
case "$repo_choice" in case "$repo_choice" in
1) _repos_enable_components ;; 1) _repos_enable_components ;;
2) _repos_migrate_format ;; 2) _repos_migrate_format ;;
3) 3)
if [ "$DEBIAN_CODENAME" = "sid" ]; then if [ "$DEBIAN_CODENAME" = "sid" ]; then
break break
else else
_repos_setup_backports _repos_setup_backports
fi fi
;; ;;
4) _branch_migration || true ;; 4) _branch_migration || true ;;
5) break ;; 5) break ;;
esac esac
done done
} }
@@ -410,9 +410,15 @@ Adding deb.debian.org may duplicate your current mirror configuration. Continue?
fi fi
if $use_deb822; then if $use_deb822; then
_write_deb822 "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || { cleanup_repo_backup; return 1; } _write_deb822 "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || {
cleanup_repo_backup
return 1
}
else else
_write_classic "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || { cleanup_repo_backup; return 1; } _write_classic "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || {
cleanup_repo_backup
return 1
}
fi fi
# Tidy: with deb822 chosen, an empty classic file is no longer needed # Tidy: with deb822 chosen, an empty classic file is no longer needed
@@ -425,7 +431,6 @@ Adding deb.debian.org may duplicate your current mirror configuration. Continue?
echo "Updating package lists..." echo "Updating package lists..."
if sudo apt update; then if sudo apt update; then
REPOS_CONFIGURED=true
cleanup_repo_backup cleanup_repo_backup
echo -e "${GREEN}Repository components configured.${NC}" echo -e "${GREEN}Repository components configured.${NC}"
return 0 return 0
@@ -514,7 +519,6 @@ Writing debian.sources may duplicate your configuration. Continue?" 10 65; then
echo "Updating package lists..." echo "Updating package lists..."
if sudo apt update; then if sudo apt update; then
REPOS_CONFIGURED=true
cleanup_repo_backup cleanup_repo_backup
echo -e "${GREEN}Repository components configured.${NC}" echo -e "${GREEN}Repository components configured.${NC}"
_repos_offer_upgrade _repos_offer_upgrade
@@ -558,7 +562,6 @@ _repos_migrate_format() {
echo "Updating package lists..." echo "Updating package lists..."
if sudo apt update; then if sudo apt update; then
REPOS_CONFIGURED=true
cleanup_repo_backup cleanup_repo_backup
echo -e "${GREEN}Repository format migrated to DEB822.${NC}" echo -e "${GREEN}Repository format migrated to DEB822.${NC}"
else else
@@ -589,8 +592,8 @@ Answer NO to disable or remove backports if they are currently enabled." 16 70;
fi fi
# Nothing to do — already in desired state # Nothing to do — already in desired state
if { $enable_backports && [ "$bp_status" = "enabled" ]; } || \ if { $enable_backports && [ "$bp_status" = "enabled" ]; } ||
{ ! $enable_backports && [ "$bp_status" = "disabled" ]; }; then { ! $enable_backports && [ "$bp_status" = "disabled" ]; }; then
echo "Backports are already configured as requested." echo "Backports are already configured as requested."
_pause _pause
return return
+25 -20
View File
@@ -19,11 +19,11 @@ config_sudo() {
clear clear
case "$choice" in case "$choice" in
1) _check_sudo_group ;; 1) _check_sudo_group ;;
2) _configure_nopasswd ;; 2) _configure_nopasswd ;;
3) _repair_home_ownership ;; 3) _repair_home_ownership ;;
4) _toggle_pwfeedback ;; 4) _toggle_pwfeedback ;;
5) return ;; 5) return ;;
esac esac
done done
} }
@@ -68,30 +68,35 @@ Useful for automation but reduces security." 14 70; then
local choices local choices
choices=$(_checklist "NOPASSWD Commands" \ choices=$(_checklist "NOPASSWD Commands" \
"Select commands to allow without password:" 12 60 3 \ "Select commands to allow without password:" 12 60 3 \
"apt" "APT package management" ON \ "apt" "APT package management" ON \
"systemctl" "Systemd service management" ON \ "systemctl" "Systemd service management" ON \
"power" "Shutdown, reboot, halt" ON) "power" "Shutdown, reboot, halt" ON)
clear clear
[ -z "$choices" ] && { echo "No commands selected."; return; } [ -z "$choices" ] && {
local cleaned; cleaned=$(echo "$choices" | tr -d '"') echo "No commands selected."
return
}
local cleaned
cleaned=$(echo "$choices" | tr -d '"')
local content="" local content=""
for cmd in $cleaned; do for cmd in $cleaned; do
case $cmd in case $cmd in
apt) apt)
content+="${USER} ALL=(root) NOPASSWD: /usr/bin/apt, /usr/bin/apt-get, /bin/apt, /bin/apt-get\n" content+="${USER} ALL=(root) NOPASSWD: /usr/bin/apt, /usr/bin/apt-get, /bin/apt, /bin/apt-get\n"
;; ;;
systemctl) systemctl)
content+="${USER} ALL=(root) NOPASSWD: /usr/bin/systemctl, /bin/systemctl\n" content+="${USER} ALL=(root) NOPASSWD: /usr/bin/systemctl, /bin/systemctl\n"
;; ;;
power) power)
content+="${USER} ALL=(root) NOPASSWD: /usr/sbin/shutdown, /sbin/shutdown, /usr/sbin/reboot, /sbin/reboot, /usr/sbin/halt, /sbin/halt\n" content+="${USER} ALL=(root) NOPASSWD: /usr/sbin/shutdown, /sbin/shutdown, /usr/sbin/reboot, /sbin/reboot, /usr/sbin/halt, /sbin/halt\n"
;; ;;
esac esac
done done
local content_str; content_str=$(echo -e "$content") local content_str
content_str=$(echo -e "$content")
if _validate_sudoers "$content_str" "$nopasswd_file"; then if _validate_sudoers "$content_str" "$nopasswd_file"; then
echo -e "${GREEN}Passwordless sudo configured for selected commands.${NC}" echo -e "${GREEN}Passwordless sudo configured for selected commands.${NC}"
else else
@@ -103,7 +108,7 @@ Useful for automation but reduces security." 14 70; then
# ── Option 3: Repair Home Directory Ownership ── # ── Option 3: Repair Home Directory Ownership ──
_repair_home_ownership() { _repair_home_ownership() {
local home local home
home=$(eval echo "~$USER") home=$(getent passwd "${SUDO_USER:-$USER}" | cut -d: -f6)
if [ ! -d "$home" ]; then if [ ! -d "$home" ]; then
_msg "Home Directory" "Home directory '$home' does not exist." 8 60 _msg "Home Directory" "Home directory '$home' does not exist." 8 60
+38 -38
View File
@@ -37,7 +37,7 @@ _show_sysinfo() {
msg+="GPU ${gpu_count}: ${desc}\n" msg+="GPU ${gpu_count}: ${desc}\n"
msg+=" Driver: ${mesa_ver:+Mesa }${mesa_ver:-unknown}\n" msg+=" Driver: ${mesa_ver:+Mesa }${mesa_ver:-unknown}\n"
fi fi
done < <(timeout 2 lspci -nn | grep -E "VGA|3D" || true) done < <(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D" || true)
fi fi
if ! $found_gpu; then if ! $found_gpu; then
@@ -52,13 +52,13 @@ _show_sysinfo() {
declare -a pci_eth_lines=() declare -a pci_eth_lines=()
while IFS= read -r line; do while IFS= read -r line; do
pci_eth_lines+=("$line") pci_eth_lines+=("$line")
done < <(timeout 2 lspci -d ::0200 2>/dev/null || true) done < <(echo "$LSPCI_OUTPUT" | grep -i 'ethernet controller' || true)
# ── 2. Detect ALL WiFi chipsets (class 0x0280 + vendor fallbacks) ── # ── 2. Detect ALL WiFi chipsets (class 0x0280 + vendor fallbacks) ──
declare -a pci_wifi_lines=() declare -a pci_wifi_lines=()
while IFS= read -r line; do while IFS= read -r line; do
pci_wifi_lines+=("$line") pci_wifi_lines+=("$line")
done < <(timeout 2 lspci -d ::0280 2>/dev/null || true) done < <(echo "$LSPCI_OUTPUT" | grep -i 'network controller' || true)
# Broadcom vendor-ID fallback (14e4) — include only if not already captured # Broadcom vendor-ID fallback (14e4) — include only if not already captured
while IFS= read -r line; do while IFS= read -r line; do
@@ -69,7 +69,7 @@ _show_sysinfo() {
done done
! $already && pci_wifi_lines+=("$line") ! $already && pci_wifi_lines+=("$line")
fi fi
done < <(timeout 2 lspci -nn 2>/dev/null || true) done < <(echo "$LSPCI_OUTPUT" || true)
# USB WiFi fallback # USB WiFi fallback
local usb_wifi_lines=() local usb_wifi_lines=()
@@ -111,7 +111,7 @@ _show_sysinfo() {
state=$(echo "$line" | awk '{print $9}') state=$(echo "$line" | awk '{print $9}')
case "$iface" in case "$iface" in
lo|docker*|veth*|br-*|virbr*|tun*|tap*|bond*) continue ;; lo | docker* | veth* | br-* | virbr* | tun* | tap* | bond*) continue ;;
esac esac
ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}') ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}')
@@ -121,13 +121,24 @@ _show_sysinfo() {
pci_class=$(cat "/sys/class/net/${iface}/device/class" 2>/dev/null || true) pci_class=$(cat "/sys/class/net/${iface}/device/class" 2>/dev/null || true)
case "$pci_class" in case "$pci_class" in
0x0200*) 0x0200*)
has_eth=true has_eth=true
desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}" desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}") shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
eth_idx=$((eth_idx + 1)) eth_idx=$((eth_idx + 1))
;; ;;
0x0280*) 0x0280*)
has_wifi=true
desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}"
shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}")
wifi_idx=$((wifi_idx + 1))
ssid=""
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
;;
*)
# Fallback: classify by interface name pattern
case "$iface" in
wl* | wlp* | wlo* | wlan*)
has_wifi=true has_wifi=true
desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}" desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}"
shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}") shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}")
@@ -135,29 +146,18 @@ _show_sysinfo() {
ssid="" ssid=""
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true) [ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
;; ;;
*) eth* | enp* | ens* | enx* | eno*)
# Fallback: classify by interface name pattern has_eth=true
case "$iface" in desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
wl*|wlp*|wlo*|wlan*) shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
has_wifi=true eth_idx=$((eth_idx + 1))
desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}"
shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}")
wifi_idx=$((wifi_idx + 1))
ssid=""
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
;;
eth*|enp*|ens*|enx*|eno*)
has_eth=true
desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
eth_idx=$((eth_idx + 1))
;;
*)
has_other=true
desc="(network interface)"
;;
esac
;; ;;
*)
has_other=true
desc="(network interface)"
;;
esac
;;
esac esac
if [ "$state" = "UP" ]; then if [ "$state" = "UP" ]; then
@@ -214,7 +214,7 @@ _show_sysinfo() {
term_cols=$(tput cols 2>/dev/null || echo 80) term_cols=$(tput cols 2>/dev/null || echo 80)
[ "$term_cols" -lt 50 ] && term_cols=50 [ "$term_cols" -lt 50 ] && term_cols=50
local max_pct=$(( term_cols * 95 / 100 )) local max_pct=$((term_cols * 95 / 100))
[ "$max_pct" -lt 50 ] && max_pct=50 [ "$max_pct" -lt 50 ] && max_pct=50
local longest=0 local longest=0
@@ -223,7 +223,7 @@ _show_sysinfo() {
[ "$len" -gt "$longest" ] && longest=$len [ "$len" -gt "$longest" ] && longest=$len
done < <(echo -e "$msg") done < <(echo -e "$msg")
local width=$(( longest + 6 )) local width=$((longest + 6))
[ "$width" -lt 80 ] && width=80 [ "$width" -lt 80 ] && width=80
[ "$width" -gt "$max_pct" ] && width=$max_pct [ "$width" -gt "$max_pct" ] && width=$max_pct
@@ -238,8 +238,8 @@ _show_sysinfo() {
local lines local lines
lines=$(echo -e "$truncated" | wc -l) lines=$(echo -e "$truncated" | wc -l)
local height=$(( lines + 6 )) local height=$((lines + 6))
local max_height=$(( ${LINES:-24} - 4 > 10 ? ${LINES:-24} - 4 : 10 )) local max_height=$((${LINES:-24} - 4 > 10 ? ${LINES:-24} - 4 : 10))
[ "$height" -gt "$max_height" ] && height=$max_height [ "$height" -gt "$max_height" ] && height=$max_height
[ "$height" -lt 10 ] && height=10 [ "$height" -lt 10 ] && height=10
+109 -63
View File
@@ -22,6 +22,12 @@ WIFI_CHIPSET=""
DESKTOP_ENV="" DESKTOP_ENV=""
AUDIO_SERVER="" AUDIO_SERVER=""
# APT update deduplication flag (set to 1 after the first successful apt-get update)
APT_UPDATED=0
# Cached output of `lspci -nn` for the whole session (populated once via _init_lspci_cache)
LSPCI_OUTPUT=""
# -------------------------- # --------------------------
# Pre-flight checks # Pre-flight checks
# -------------------------- # --------------------------
@@ -109,7 +115,7 @@ _ensure_time_synced() {
if [ -n "${DISPLAY:-}" ] || [ -n "${SSH_TTY:-}" ]; then if [ -n "${DISPLAY:-}" ] || [ -n "${SSH_TTY:-}" ]; then
_msg "Timezone" \ _msg "Timezone" \
"Your system timezone is not set or is set to UTC.\n\nThe script will now open the timezone\nconfiguration tool to set your local timezone." 12 60 "Your system timezone is not set or is set to UTC.\n\nThe script will now open the timezone\nconfiguration tool to set your local timezone." 12 60
sudo env LC_ALL=C LANGUAGE=C dpkg-reconfigure tzdata || true sudo env LC_ALL=C LANGUAGE=C dpkg-reconfigure tzdata || true
echo -e "${GREEN}Timezone configured: $(timedatectl show -p Timezone --value 2>/dev/null)${NC}" echo -e "${GREEN}Timezone configured: $(timedatectl show -p Timezone --value 2>/dev/null)${NC}"
else else
echo -e "${YELLOW}Timezone not set. Run 'sudo dpkg-reconfigure tzdata' later.${NC}" echo -e "${YELLOW}Timezone not set. Run 'sudo dpkg-reconfigure tzdata' later.${NC}"
@@ -136,7 +142,7 @@ sudo env LC_ALL=C LANGUAGE=C dpkg-reconfigure tzdata || true
# Debian version detection # Debian version detection
# -------------------------------- # --------------------------------
detect_debian_version() { detect_debian_version() {
if ! command -v lsb_release &> /dev/null; then if ! command -v lsb_release &>/dev/null; then
if [ -f /etc/os-release ]; then if [ -f /etc/os-release ]; then
DEBIAN_CODENAME=$(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release 2>/dev/null || echo "") DEBIAN_CODENAME=$(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release 2>/dev/null || echo "")
fi fi
@@ -149,13 +155,13 @@ detect_debian_version() {
DEBIAN_CODENAME=$(lsb_release -cs 2>/dev/null || echo "") DEBIAN_CODENAME=$(lsb_release -cs 2>/dev/null || echo "")
fi fi
case "$DEBIAN_CODENAME" in case "$DEBIAN_CODENAME" in
bullseye) DEBIAN_VERSION="11" ;; bullseye) DEBIAN_VERSION="11" ;;
bookworm) DEBIAN_VERSION="12" ;; bookworm) DEBIAN_VERSION="12" ;;
trixie) DEBIAN_VERSION="13" ;; trixie) DEBIAN_VERSION="13" ;;
*) *)
echo -e "${RED}Unsupported Debian version: '$DEBIAN_CODENAME'. Only 11 (bullseye), 12 (bookworm) and 13 (trixie) are supported.${NC}" echo -e "${RED}Unsupported Debian version: '$DEBIAN_CODENAME'. Only 11 (bullseye), 12 (bookworm) and 13 (trixie) are supported.${NC}"
exit 1 exit 1
;; ;;
esac esac
} }
@@ -225,12 +231,23 @@ detect_kernel() {
KERNEL_VERSION=$(uname -r) KERNEL_VERSION=$(uname -r)
} }
# ----------------------------------
# lspci output cache
# ----------------------------------
# Populates LSPCI_OUTPUT once per session. `lspci -nn` includes the textual PCI
# class (VGA/3D/Ethernet/Network/Bluetooth controller) and the device IDs
# (e.g. 14e4:), so a single capture covers every grep used across modules.
_init_lspci_cache() {
[ -n "${LSPCI_OUTPUT:-}" ] && return
LSPCI_OUTPUT=$(timeout 2 lspci -nn 2>/dev/null || true)
}
# ---------------------------------- # ----------------------------------
# GPU detection # GPU detection
# ---------------------------------- # ----------------------------------
detect_gpu() { detect_gpu() {
local gpu_lines local gpu_lines
gpu_lines=$(timeout 2 lspci -nn | grep -E "VGA|3D") || true gpu_lines=$(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D") || true
if [ -z "$gpu_lines" ]; then if [ -z "$gpu_lines" ]; then
GPU_TYPE="unknown" GPU_TYPE="unknown"
GPU_DESC="No GPU detected" GPU_DESC="No GPU detected"
@@ -257,7 +274,7 @@ detect_gpu() {
has_intel=true has_intel=true
[ -z "$intel_dev_id" ] && intel_dev_id=$(echo "$line" | grep -oP '8086:\K[0-9a-fA-F]+' | head -n1) [ -z "$intel_dev_id" ] && intel_dev_id=$(echo "$line" | grep -oP '8086:\K[0-9a-fA-F]+' | head -n1)
fi fi
done <<< "$gpu_lines" done <<<"$gpu_lines"
GPU_DESC="$desc_lines" GPU_DESC="$desc_lines"
HAS_NVIDIA=$has_nvidia HAS_NVIDIA=$has_nvidia
@@ -322,21 +339,21 @@ declare -a WIFI_SSIDS=()
detect_network() { detect_network() {
local eth_line local eth_line
eth_line=$(timeout 2 lspci -nn | grep -i 'Ethernet controller' | head -n1) || true eth_line=$(echo "$LSPCI_OUTPUT" | grep -i 'Ethernet controller' | head -n1) || true
if [ -n "$eth_line" ]; then if [ -n "$eth_line" ]; then
ETH_DESC=$(echo "$eth_line" | sed -E 's/^.*\]: //; s/ \[[0-9a-fA-F]{4}:[0-9a-fA-F]{4}\]//; s/ \(rev [0-9a-fA-F]+\)//') ETH_DESC=$(echo "$eth_line" | sed -E 's/^.*\]: //; s/ \[[0-9a-fA-F]{4}:[0-9a-fA-F]{4}\]//; s/ \(rev [0-9a-fA-F]+\)//')
fi fi
local wifi_line local wifi_line
# Layer 1: grep by PCI class description text # Layer 1: grep by PCI class description text
wifi_line=$(timeout 2 lspci -nn 2>/dev/null | grep -iE 'network controller|wireless|wi-fi|wlan|802\.11' | head -n1) || true wifi_line=$(echo "$LSPCI_OUTPUT" | grep -iE 'network controller|wireless|wi-fi|wlan|802\.11' | head -n1) || true
# Layer 2: grep by exact PCI class code 0x0280 (Network controller) # Layer 2: grep by exact PCI class code 0x0280 (Network controller)
if [ -z "$wifi_line" ]; then if [ -z "$wifi_line" ]; then
wifi_line=$(timeout 2 lspci -d ::0280 2>/dev/null | head -n1) || true wifi_line=$(echo "$LSPCI_OUTPUT" | grep -i 'network controller' | head -n1) || true
fi fi
# Layer 3: Broadcom vendor ID fallback (14e4) # Layer 3: Broadcom vendor ID fallback (14e4)
if [ -z "$wifi_line" ]; then if [ -z "$wifi_line" ]; then
wifi_line=$(timeout 2 lspci -nn 2>/dev/null | grep -i '14e4:' | head -n1) || true wifi_line=$(echo "$LSPCI_OUTPUT" | grep -i '14e4:' | head -n1) || true
fi fi
if [ -n "$wifi_line" ]; then if [ -n "$wifi_line" ]; then
WIFI_CHIPSET="$wifi_line" WIFI_CHIPSET="$wifi_line"
@@ -363,23 +380,23 @@ detect_network() {
iface=$(echo "$line" | awk -F': ' '{print $2}' | sed 's/@.*//') iface=$(echo "$line" | awk -F': ' '{print $2}' | sed 's/@.*//')
state=$(echo "$line" | awk '{print $9}') state=$(echo "$line" | awk '{print $9}')
case "$iface" in case "$iface" in
eth*|enp*|ens*|enx*|eno*) eth* | enp* | ens* | enx* | eno*)
ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}') ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}')
ETH_NAMES+=("$iface") ETH_NAMES+=("$iface")
ETH_STATES+=("$state") ETH_STATES+=("$state")
ETH_IPS+=("${ip4:-}") ETH_IPS+=("${ip4:-}")
ETH_DESCS+=("${ETH_DESC:-}") ETH_DESCS+=("${ETH_DESC:-}")
;; ;;
wl*|wlp*|wlo*|wlan*) wl* | wlp* | wlo* | wlan*)
ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}') ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}')
ssid="" ssid=""
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true) [ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
WIFI_NAMES+=("$iface") WIFI_NAMES+=("$iface")
WIFI_STATES+=("$state") WIFI_STATES+=("$state")
WIFI_IPS+=("${ip4:-}") WIFI_IPS+=("${ip4:-}")
WIFI_SSIDS+=("${ssid:-}") WIFI_SSIDS+=("${ssid:-}")
WIFI_DESCS+=("${WIFI_DESC:-}") WIFI_DESCS+=("${WIFI_DESC:-}")
;; ;;
esac esac
done < <(timeout 2 ip -o link show 2>/dev/null) done < <(timeout 2 ip -o link show 2>/dev/null)
} }
@@ -390,18 +407,18 @@ detect_network() {
detect_displayserver() { detect_displayserver() {
local st="${XDG_SESSION_TYPE:-}" local st="${XDG_SESSION_TYPE:-}"
case "$st" in case "$st" in
wayland) DISPLAY_SERVER="Wayland" ;; wayland) DISPLAY_SERVER="Wayland" ;;
x11) DISPLAY_SERVER="X11" ;; x11) DISPLAY_SERVER="X11" ;;
tty) DISPLAY_SERVER="none (tty)" ;; tty) DISPLAY_SERVER="none (tty)" ;;
*) *)
if [ -n "${WAYLAND_DISPLAY:-}" ]; then if [ -n "${WAYLAND_DISPLAY:-}" ]; then
DISPLAY_SERVER="Wayland" DISPLAY_SERVER="Wayland"
elif [ -n "${DISPLAY:-}" ]; then elif [ -n "${DISPLAY:-}" ]; then
DISPLAY_SERVER="X11" DISPLAY_SERVER="X11"
else else
DISPLAY_SERVER="unknown" DISPLAY_SERVER="unknown"
fi fi
;; ;;
esac esac
} }
@@ -451,10 +468,10 @@ detect_storage() {
# --------------------------------------- # ---------------------------------------
detect_desktop_environment() { detect_desktop_environment() {
case "${XDG_CURRENT_DESKTOP:-}" in case "${XDG_CURRENT_DESKTOP:-}" in
*GNOME*) DESKTOP_ENV="gnome" ;; *GNOME*) DESKTOP_ENV="gnome" ;;
*KDE*) DESKTOP_ENV="kde" ;; *KDE*) DESKTOP_ENV="kde" ;;
*XFCE*) DESKTOP_ENV="xfce" ;; *XFCE*) DESKTOP_ENV="xfce" ;;
*) DESKTOP_ENV="other" ;; *) DESKTOP_ENV="other" ;;
esac esac
} }
@@ -483,7 +500,7 @@ get_intel_generation() {
fi fi
local dev_int local dev_int
dev_int=$(printf "%d" "$INTEL_GPU_DEVICE_ID") dev_int=$(printf "%d" "$INTEL_GPU_DEVICE_ID")
if [ "$dev_int" -lt 5632 ]; then # 0x1600 = 5632 if [ "$dev_int" -lt 5632 ]; then # 0x1600 = 5632
echo "gen7-" echo "gen7-"
else else
echo "gen8+" echo "gen8+"
@@ -498,37 +515,42 @@ get_intel_generation() {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
is_backports_enabled() { is_backports_enabled() {
local codename="${DEBIAN_CODENAME:-}" local codename="${DEBIAN_CODENAME:-}"
[ -z "$codename" ] && { echo false; return; } [ -z "$codename" ] && {
echo false
return
}
local c_pattern="^[^#]*${codename}-backports[[:space:]]+" local c_pattern="^[^#]*${codename}-backports[[:space:]]+"
local d_pattern="Suites:.*${codename}-backports" local d_pattern="Suites:.*${codename}-backports"
# Classic embedded (sources.list) # Classic embedded (sources.list)
if [ -f /etc/apt/sources.list ] && grep -Eq "$c_pattern" /etc/apt/sources.list 2>/dev/null; then if [ -f /etc/apt/sources.list ] && grep -Eq "$c_pattern" /etc/apt/sources.list 2>/dev/null; then
echo true; return echo true
return
fi fi
# Classic standalone (any .list file in sources.list.d) # Classic standalone (any .list file in sources.list.d)
if [ -d /etc/apt/sources.list.d ] && grep -qrE "$c_pattern" /etc/apt/sources.list.d/*.list 2>/dev/null; then if [ -d /etc/apt/sources.list.d ] && grep -qrE "$c_pattern" /etc/apt/sources.list.d/*.list 2>/dev/null; then
echo true; return echo true
return
fi fi
# Deb822 any .sources file # Deb822 any .sources file
if [ -d /etc/apt/sources.list.d ] && grep -qr "$d_pattern" /etc/apt/sources.list.d/*.sources 2>/dev/null; then if [ -d /etc/apt/sources.list.d ] && grep -qr "$d_pattern" /etc/apt/sources.list.d/*.sources 2>/dev/null; then
echo true; return echo true
return
fi fi
echo false echo false
} }
install_backports_or_stable() { install_backports_or_stable() {
local pkg="$1" local pkg="$1"
local pkg_desc="${2:-$pkg}" local pkg_desc="${2:-$pkg}"
local bpo_ver="" local bpo_ver=""
if [ "$(is_backports_enabled)" == true ]; then if [ "$(is_backports_enabled)" == true ]; then
bpo_ver=$(apt-cache madison "$pkg" 2>/dev/null | \ bpo_ver=$(apt-cache madison "$pkg" 2>/dev/null |
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
fi fi
@@ -594,17 +616,20 @@ _msg_red() {
} }
_menu() { _menu() {
local title="$1" text="$2" h="$3" w="$4" lh="$5"; shift 5 local title="$1" text="$2" h="$3" w="$4" lh="$5"
shift 5
whiptail --title "$title" --menu "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true whiptail --title "$title" --menu "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true
} }
_checklist() { _checklist() {
local title="$1" text="$2" h="$3" w="$4" lh="$5"; shift 5 local title="$1" text="$2" h="$3" w="$4" lh="$5"
shift 5
whiptail --title "$title" --ok-button "Apply" --checklist "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true whiptail --title "$title" --ok-button "Apply" --checklist "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true
} }
_radiolist() { _radiolist() {
local title="$1" text="$2" h="$3" w="$4" lh="$5"; shift 5 local title="$1" text="$2" h="$3" w="$4" lh="$5"
shift 5
whiptail --title "$title" --ok-button "Install" --radiolist "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true whiptail --title "$title" --ok-button "Install" --radiolist "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true
} }
@@ -616,7 +641,7 @@ _validate_sudoers() {
local content="$1" dest="$2" local content="$1" dest="$2"
local tmpfile local tmpfile
tmpfile=$(mktemp) || return 1 tmpfile=$(mktemp) || return 1
echo "$content" > "$tmpfile" echo "$content" >"$tmpfile"
if ! /usr/sbin/visudo -cf "$tmpfile" &>/dev/null; then if ! /usr/sbin/visudo -cf "$tmpfile" &>/dev/null; then
local err local err
err=$(/usr/sbin/visudo -cf "$tmpfile" 2>&1 || true) err=$(/usr/sbin/visudo -cf "$tmpfile" 2>&1 || true)
@@ -701,8 +726,8 @@ _run_install_pkg() {
get_backports_kernel_version() { get_backports_kernel_version() {
local ver local ver
ver=$(apt-cache policy linux-image-amd64 2>/dev/null | \ ver=$(apt-cache policy linux-image-amd64 2>/dev/null |
grep -E '^[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+.*~bpo' | head -n1 | awk '{print $1}') grep -E '^[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+.*~bpo' | head -n1 | awk '{print $1}')
if [ -n "$ver" ]; then if [ -n "$ver" ]; then
echo "$ver" echo "$ver"
else else
@@ -759,10 +784,29 @@ _check_network() {
return 1 return 1
} }
# ----------------------------------
# APT update deduplication
# ----------------------------------
# Runs `apt-get update` at most once per session. Subsequent calls bypass the
# network refresh. Returns 0 on success, 1 if apt-get update fails.
_ensure_apt_updated() {
if [ "$APT_UPDATED" -eq 1 ]; then
echo -e "${GREEN}[+]${NC} APT package lists already refreshed this session."
return 0
fi
echo -e "${GREEN}[+]${NC} Refreshing APT package lists..."
if sudo apt-get update; then
APT_UPDATED=1
return 0
fi
echo -e "${RED}[-]${NC} apt-get update failed."
return 1
}
# ---------------------------------- # ----------------------------------
# LightDM configuration # LightDM configuration
# ---------------------------------- # ----------------------------------
_configure_lightdm() { _configure_lightdm() {
command -v lightdm &>/dev/null || return 0 command -v lightdm &>/dev/null || return 0
if _confirm "LightDM" "Configure LightDM to show the user list on the login screen?\n\nThis disables greeter-hide-users."; then if _confirm "LightDM" "Configure LightDM to show the user list on the login screen?\n\nThis disables greeter-hide-users."; then
@@ -782,7 +826,7 @@ _check_network() {
fi fi
sudo mkdir -p "$conf_dir" sudo mkdir -p "$conf_dir"
printf '[Seat:*]\ngreeter-hide-users=false\n' | sudo tee "$conf_file" > /dev/null printf '[Seat:*]\ngreeter-hide-users=false\n' | sudo tee "$conf_file" >/dev/null
echo -e "${GREEN}LightDM configured to show user list.${NC}" echo -e "${GREEN}LightDM configured to show user list.${NC}"
fi fi
} }
@@ -792,4 +836,6 @@ refresh_system_state() {
detect_debian_version detect_debian_version
detect_gpu detect_gpu
detect_cpu_ram detect_cpu_ram
detect_network
detect_desktop_environment
} }