From 63ef2e734335e4e0a26d6540411da941ab008556 Mon Sep 17 00:00:00 2001 From: stornic56 <71296607+stornic56@users.noreply.github.com> Date: Tue, 16 Jun 2026 16:20:30 -0500 Subject: [PATCH] dual-gpu fix & nvme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replaced the restrictive head -n1 hardware parsing with a dynamic while read loop. The script now fully detects and registers multiple coexisting GPUs (Intel+Nvidia / AMD+Nvidia). - Rewrote install_gpu_drivers() in modules/gpu.sh from a mutually exclusive case block to independent, sequential if conditions. Laptops now install both integrated firmware (Intel/AMD with non-free VA-API acceleration) and dedicated graphics stacks (Nvidia driver + 32-bit libs for Steam) seamlessly in a single pass. - Improved Nvidia Kepler architecture guards under Debian 13 (Trixie). The script now safely skips missing legacy Nvidia packages without aborting or crashing the remaining Intel/AMD configurations. - Added nvme-cli utility installation across all Debian versions. For Bookworm and Trixie, it features dynamic hardware validation via lsblk transport filtering and interactive, real-time SMART log viewing with an execution screen-pause. - Created a brand new standalone module (modules/extras/dev/jellyfin.sh) to cleanly inject Jellyfin Media Server across Debian 11, 12, and 13 using its official setup script, protected by strict SHA256 checksum validations and guaranteed error-cleanup. - Added OpenRGB to the Gaming menu for Debian 12 and 13. Implemented secure curl downloads with an emulated Chrome User-Agent to bypass Codeberg bot blocks, complete with automatic i2c-dev module configuration, user groups provisioning, and udev permission rules execution. - Standardized menu headers across 15 separate files using a centralized readonly SCROLL_HINT=" [↑↓]" variable, replacing messy hardcoded strings with clean, uniform Whiptail instructions. - update README.md --- README.md | 10 +- modules/bullseye/extras.sh | 40 +++-- modules/extras.sh | 2 +- modules/extras/design/design.sh | 2 +- modules/extras/dev/dev.sh | 6 +- modules/extras/dev/jellyfin.sh | 32 ++++ modules/extras/internet/internet.sh | 2 +- modules/extras/programming/programming.sh | 2 +- modules/extras/security/security.sh | 2 +- modules/extras/system/software_centers.sh | 4 +- modules/extras/system/system.sh | 26 ++- modules/extras/themes/cursors/cursors.sh | 2 +- .../themes/desktop-themes/desktop-themes.sh | 2 +- modules/extras/themes/fonts/fonts.sh | 2 +- modules/extras/themes/icons/icons.sh | 2 +- modules/gaming.sh | 10 +- modules/gaming/tools.sh | 41 +++++ modules/gpu.sh | 160 +++++++++--------- modules/utils.sh | 51 ++++-- 19 files changed, 269 insertions(+), 129 deletions(-) create mode 100644 modules/extras/dev/jellyfin.sh diff --git a/README.md b/README.md index fe4763b..dd1408f 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ After running the script: | **4** | Setup Wireless & Firmware | Install WiFi firmware for Broadcom, Intel, and other chipsets| | **5** | Configure Graphics Stack | AMD/Intel/NVIDIA drivers + monitoring tools | | **6** | Update Kernel to Backports | Install latest kernel from Debian backports| -| **7** | Gaming Setup and Performance | Steam, Heroic Games Launcher, GameMode, MangoHud, Java JRE (Temurin 8/17/21) | +| **7** | Gaming Setup and Performance | Steam, Heroic Games Launcher, GameMode, MangoHud, OpenRGB Java JRE (Temurin 8/17/21) | | **8** | Install ZRAM (compressed swap) | Configure compressed RAM for memory optimization| | **9** | Install Programs and Software | Selection from several categories (Development, Themes, System, etc.) | | **10** | Exit | Return to terminal | @@ -71,10 +71,10 @@ The submenu offers the next categories: | **4** | Media Players | Multimedia playback with VLC media player and MPV for advanced video/audio support | | **5** | Multimedia & Design | image editing (GIMP), video editing (Kdenlive, HandBrake), 3D modeling (Blender), audio recording (Audacity), and graphics design (Inkscape) | | **6** | Code Editors & IDEs | vim, vim-gtk3, Neovim, Helix, nano, Emacs, Kate, Mousepad, Gedit, Geany, GNOME Text Editor, and VSCodium (VS Code open-source) | -| **7** | Servers & Dev Tools | Web servers (Nginx/Apache), databases (PostgreSQL/MariaDB), Java Development Kit (Temurin 17/21/25 JDK), Docker, Python, SSH tools, fail2ban, and essential utilities | +| **7** | Servers & Dev Tools | Web servers (Nginx/Apache), databases (PostgreSQL/MariaDB), Java Development Kit (Temurin 17/21/25 JDK), Docker, Python, SSH tools, fail2ban, Jellyfin Server and essential utilities | | **8** | Security & Networking | Wireshark, tcpdump, Zenmap, ClamAV, UFW, Fail2ban | | **9** | Software Centers | Choose a software store to install | -| **10** | System Tools | htop/btop, ncdu, Timeshift, tmux/screen, Flatpak support, extension repository manager, and qemu/virtmanager | +| **10** | System Tools | htop/btop, ncdu, Timeshift, tmux/screen, nvme-cli Flatpak support, extension repository manager and qemu/virtmanager | | **11** | Fetch / System Info | fastfetch/neofetch, hyfetch, Linux logo and screenfetch | | **12** | Back to Main Menu | Return directly to the main Debianito menu (exit submenu) | @@ -118,7 +118,8 @@ By default, Debian’s terminal hides your password (no asterisks or feedback). │   │   ├── design │   │   │   └── design.sh │   │   ├── dev -│   │   │   └── dev.sh +│   │   │   ├── dev.sh +│   │   │   └── jellyfin.sh │   │   ├── download │   │   │   └── download.sh │   │   ├── essential @@ -169,7 +170,6 @@ By default, Debian’s terminal hides your password (no asterisks or feedback). │   ├── utils.sh │   └── zram.sh └── README.md - ``` --- diff --git a/modules/bullseye/extras.sh b/modules/bullseye/extras.sh index 3293bdc..34a9f56 100644 --- a/modules/bullseye/extras.sh +++ b/modules/bullseye/extras.sh @@ -70,7 +70,7 @@ _cat_customization_bullseye() { _cat_themes_bullseye() { local choices choices=$(whiptail --title "Desktop Themes (Bullseye)" --checklist \ - "Select desktop themes:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select desktop themes${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "arc-theme" "Arc GTK theme$(_inst arc-theme)" "$(_state arc-theme)" \ "blackbird-gtk-theme" "Blackbird GTK theme$(_inst blackbird-gtk-theme)" "$(_state blackbird-gtk-theme)" \ "bluebird-gtk-theme" "Bluebird GTK theme$(_inst bluebird-gtk-theme)" "$(_state bluebird-gtk-theme)" \ @@ -101,7 +101,7 @@ _cat_icons_bullseye() { ) local choices choices=$(whiptail --title "Icon Themes (Bullseye)" --checklist \ - "Select icon themes:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select icon themes${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "${items[@]}" 3>&1 1>&2 2>&3) clear [ -z "$choices" ] && return @@ -115,7 +115,7 @@ _cat_icons_bullseye() { _cat_cursors_bullseye() { local choices choices=$(whiptail --title "Cursor Themes (Bullseye)" --checklist \ - "Select cursor themes:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select cursor themes${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "breeze-cursor-theme" "Breeze cursors (KDE)$(_inst breeze-cursor-theme)" "$(_state breeze-cursor-theme)" \ "chameleon-cursor-theme" "Chameleon cursors$(_inst chameleon-cursor-theme)" "$(_state chameleon-cursor-theme)" \ "dmz-cursor-theme" "DMZ cursors$(_inst dmz-cursor-theme)" "$(_state dmz-cursor-theme)" \ @@ -134,7 +134,7 @@ _cat_cursors_bullseye() { _cat_fonts_bullseye() { local choices choices=$(whiptail --title "Fonts (Bullseye)" --checklist \ - "Available fonts:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Available fonts${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "fonts-firacode" "Fira Code monospace font$(_inst fonts-firacode)" "$(_state fonts-firacode)" \ "fonts-noto" "Noto fonts (Google)$(_inst fonts-noto)" "$(_state fonts-noto)" \ "fonts-dejavu-core" "DejaVu core fonts$(_inst fonts-dejavu-core)" "$(_state fonts-dejavu-core)" \ @@ -160,7 +160,7 @@ _cat_download_bullseye() { clear choices2=$(whiptail --title "Torrent Clients" --checklist \ - "Select torrent clients:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select torrent clients${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "deluge" "BitTorrent client (GTK)$(_inst deluge)" "$(_state deluge)" \ "deluged" "BitTorrent daemon/server$(_inst deluged)" "$(_state deluged)" \ "mktorrent" "Torrent metainfo creator (CLI)$(_inst mktorrent)" "$(_state mktorrent)" \ @@ -189,7 +189,7 @@ _cat_download_bullseye() { _cat_internet_bullseye() { local choices choices=$(whiptail --title "Internet (Bullseye)" --checklist \ - "Select browsers, email:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select browsers, email${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "chromium" "Chromium web browser$(_inst chromium)" "$(_state chromium)" \ "dillo" "Lightweight graphical browser$(_inst dillo)" "$(_state dillo)" \ "elinks" "Text-mode web browser$(_inst elinks)" "$(_state elinks)" \ @@ -230,7 +230,7 @@ _cat_internet_bullseye() { _cat_players_bullseye() { local choices choices=$(whiptail --title "Media Players (Bullseye)" --checklist \ - "Select media players:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select media players${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "mpv" "Lightweight media player$(_inst mpv)" "$(_state mpv)" \ "vlc" "VLC media player$(_inst vlc)" "$(_state vlc)" \ 3>&1 1>&2 2>&3) @@ -250,7 +250,7 @@ _cat_players_bullseye() { _cat_design_bullseye() { local choices choices=$(whiptail --title "Multimedia & Design (Bullseye)" --checklist \ - "Select multimedia and design tools:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select multimedia and design tools${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "ardour" "Digital audio workstation$(_inst ardour)" "$(_state ardour)" \ "audacity" "Audio editor/recorder$(_inst audacity)" "$(_state audacity)" \ "blender" "3D modeling/animation suite$(_inst blender)" "$(_state blender)" \ @@ -281,7 +281,7 @@ _cat_design_bullseye() { _cat_programming_bullseye() { local choices choices=$(whiptail --title "Code Editors & IDEs (Bullseye)" --checklist \ - "Select editors and IDEs:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select editors and IDEs${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "vim" "Classic terminal editor$(_inst vim)" "$(_state vim)" \ "vim-gtk3" "Vim with GTK3 GUI$(_inst vim-gtk3)" "$(_state vim-gtk3)" \ "neovim" "Modern vim fork$(_inst neovim)" "$(_state neovim)" \ @@ -308,7 +308,7 @@ _cat_programming_bullseye() { _cat_dev_bullseye() { local choices choices=$(whiptail --title "Servers & Dev Tools (Bullseye)" --checklist \ - "Select development tools and servers:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select development tools and servers${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "apache2" "Apache web server$(_inst apache2)" "$(_state apache2)" \ "build-essential" "C/C++ build tools (gcc, make)$(_inst build-essential)" "$(_state build-essential)" \ "docker" "Docker container runtime$(_inst docker.io)" "$(_state docker.io)" \ @@ -321,6 +321,7 @@ _cat_dev_bullseye() { "python3-pip" "Python 3 pip + venv + dev$(_inst python3-pip)" "$(_state python3-pip)" \ "redis-server" "Redis key-value store$(_inst redis-server)" "$(_state redis-server)" \ "sqlite3" "SQLite database engine$(_inst sqlite3)" "$(_state sqlite3)" \ + "jellyfin" "Jellyfin Media Server (Web GUI on port 8096)$(_inst jellyfin)" OFF \ "openjdk-dev-env" "Adoptium Temurin JDK (17, 21, 25 LTS)$(_any_jdk_installed_desc)" "$(_any_jdk_state)" \ 3>&1 1>&2 2>&3) clear @@ -349,9 +350,13 @@ _cat_dev_bullseye() { echo "Python 3 tools already installed." fi ;; + jellyfin) + install_jellyfin + ;; openjdk-dev-env) _install_dev_java ;; + *) if ! is_installed "$pkg"; then _run_install "$pkg" @@ -363,11 +368,10 @@ _cat_dev_bullseye() { done echo -e "${GREEN}Servers & dev tools installed.${NC}" } - _cat_security_bullseye() { local choices choices=$(whiptail --title "Security & Networking (Bullseye)" --checklist \ - "Select security and networking tools:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select security and networking tools${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "wireshark" "Network protocol analyzer (GUI)$(_inst wireshark)" "$(_state wireshark)" \ "tcpdump" "Command-line packet analyzer$(_inst tcpdump)" "$(_state tcpdump)" \ "fail2ban" "Brute-force protection daemon$(_inst fail2ban)" "$(_state fail2ban)" \ @@ -397,7 +401,7 @@ _cat_security_bullseye() { _cat_general_bullseye() { local choices choices=$(whiptail --title "System Tools (Bullseye)" --checklist \ - "Select system utilities:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select system utilities${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "compress" "Compression tools (zip, unrar, p7zip)$(_inst zip)" "$(_state zip)" \ "conky" "System monitor for desktop$(_inst conky)" "$(_state conky)" \ "cpu-x" "CPU-X (alternative to CPU-Z)$(_inst cpu-x)" "$(_state cpu-x)" \ @@ -411,6 +415,7 @@ _cat_general_bullseye() { "kvm" "QEMU/KVM virtualization$(_inst virt-manager)" "$(_state virt-manager)" \ "lshw" "List hardware details$(_inst lshw)" "$(_state lshw)" \ "mc" "Midnight Commander$(_inst mc)" "$(_state mc)" \ + "nvme-cli" "NVMe SSD health monitoring$(_inst nvme-cli)" "$(_state nvme-cli)" \ "ncdu" "Disk usage analyzer$(_inst ncdu)" "$(_state ncdu)" \ "psensor" "Temperature monitor$(_inst psensor)" "$(_state psensor)" \ "timeshift" "System restore snapshots$(_inst timeshift)" "$(_state timeshift)" \ @@ -478,6 +483,9 @@ _cat_general_bullseye() { sudo fwupdmgr get-updates 2>&1 || true fi ;; + nvme-cli) + _run_install "nvme-cli" + ;; *) if ! is_installed "$pkg"; then _run_install "$pkg" @@ -524,7 +532,7 @@ install_extras_bullseye() { while true; do local cat_choice cat_choice=$(whiptail --title "Extra Software — Bullseye" --menu \ - "Select a category:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select a category${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "0" "Essential Pack" \ "1" "Customization System" \ "2" "Download & Network" \ @@ -566,8 +574,8 @@ _cat_software_centers_bullseye() { local sc_choice sc_choice=$(whiptail --title "Software Centers" --menu \ "Choose a software store to install:" 12 65 2 \ - "gnome-software" "Software Center for GNOME" \ - "plasma-discover" "Software manager for Plasma" \ + "gnome-software" "Software Center for GNOME$(_inst gnome-software)" \ + "plasma-discover" "Software manager for Plasma$(_inst plasma-discover)" \ 3>&1 1>&2 2>&3) [ -z "$sc_choice" ] && return diff --git a/modules/extras.sh b/modules/extras.sh index f7488be..13af6d2 100644 --- a/modules/extras.sh +++ b/modules/extras.sh @@ -28,7 +28,7 @@ install_extras() { while true; do local cat_choice cat_choice=$(whiptail --title "Extra Software" --menu \ - "Select a category:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select a category${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "0" "Essential Pack" \ "1" "Customization System" \ "2" "Download & Network" \ diff --git a/modules/extras/design/design.sh b/modules/extras/design/design.sh index 29f4d5d..7cf5dd6 100644 --- a/modules/extras/design/design.sh +++ b/modules/extras/design/design.sh @@ -20,7 +20,7 @@ _cat_design() { local choices choices=$(whiptail --title "Multimedia & Design" --checklist \ - "Select multimedia and design tools:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select multimedia and design tools${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "audacity" "Audio editor/recorder$(_inst audacity)" "$audacity_state" \ "ardour" "Digital audio workstation$(_inst ardour)" "$ardour_state" \ "blender" "3D modeling/animation suite$(_inst blender)" "$blender_state" \ diff --git a/modules/extras/dev/dev.sh b/modules/extras/dev/dev.sh index ca30820..1023e31 100644 --- a/modules/extras/dev/dev.sh +++ b/modules/extras/dev/dev.sh @@ -23,7 +23,7 @@ _cat_dev() { local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6)) local choices choices=$(whiptail --title "Development & Servers" --checklist \ - "Select development tools and servers (12 items, ↑↓ scroll):" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ + "Select development tools and servers${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ "apache2" "Apache web server$(_inst apache2)" "$apache_state" \ "build-essential" "C/C++ build tools (gcc, make)$(_inst build-essential)" "$build_state" \ "certbot" "Let's Encrypt TLS certificates$(_inst certbot)" "$certbot_state" \ @@ -37,6 +37,7 @@ _cat_dev() { "python3-pip" "Python 3 pip + venv + dev$(_inst python3-pip)" "$pip_state" \ "redis-server" "Redis key-value store$(_inst redis-server)" "$redis_state" \ "sqlite3" "SQLite database engine$(_inst sqlite3)" "$sqlite_state" \ + "jellyfin" "Jellyfin Media Server (Web GUI on port 8096)$(_inst jellyfin)" OFF \ "openjdk-dev-env" "Adoptium Temurin JDK (17, 21, 25 LTS)${jdk_desc}" "${jdk_state}" \ 3>&1 1>&2 2>&3) clear @@ -68,6 +69,9 @@ _cat_dev() { echo "Docker already installed." fi ;; + jellyfin) + install_jellyfin + ;; openjdk-dev-env) _install_dev_java ;; diff --git a/modules/extras/dev/jellyfin.sh b/modules/extras/dev/jellyfin.sh new file mode 100644 index 0000000..076fb22 --- /dev/null +++ b/modules/extras/dev/jellyfin.sh @@ -0,0 +1,32 @@ +# jellyfin.sh — Jellyfin Media Server installation + +install_jellyfin() { + local tmpdir="/tmp/jellyfin_install" + mkdir -p "${tmpdir}" + + _run_cmd "Jellyfin" "curl -sSL -o ${tmpdir}/install-debuntu.sh https://repo.jellyfin.org/install-debuntu.sh" "Downloading Jellyfin repository script..." + _run_cmd "Jellyfin" "curl -sSL -o ${tmpdir}/install-debuntu.sh.sha256sum https://repo.jellyfin.org/install-debuntu.sh.sha256sum" "Downloading checksum..." + + if [ ! -s "${tmpdir}/install-debuntu.sh" ] || [ ! -s "${tmpdir}/install-debuntu.sh.sha256sum" ]; then + echo -e "${RED}[-]${NC} Download failed: script or checksum is empty or missing." + rm -rf "${tmpdir}" + return 1 + fi + + echo -e "${GREEN}[+]${NC} Verifying checksum..." + if ! (cd "${tmpdir}" && sha256sum -c install-debuntu.sh.sha256sum); then + echo -e "${RED}[-]${NC} Checksum verification failed. The downloaded script may be corrupted." + rm -rf "${tmpdir}" + return 1 + fi + + echo -e "${GREEN}[+]${NC} Running Jellyfin repository setup..." + if ! sudo bash "${tmpdir}/install-debuntu.sh"; then + echo -e "${RED}[-]${NC} Jellyfin installation failed." + rm -rf "${tmpdir}" + return 1 + fi + + rm -rf "${tmpdir}" + echo -e "${GREEN}Jellyfin Server installed. Web interface available at http://localhost:8096${NC}" +} diff --git a/modules/extras/internet/internet.sh b/modules/extras/internet/internet.sh index aff0f04..d0fced6 100644 --- a/modules/extras/internet/internet.sh +++ b/modules/extras/internet/internet.sh @@ -25,7 +25,7 @@ _cat_internet() { local choices choices=$(whiptail --title "Internet" --checklist \ - "Select browsers, email, and VPN tools:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select browsers, email, and VPN tools${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "chromium" "Chromium web browser$(_inst chromium)" "$chromium_state" \ "dillo" "Lightweight graphical browser$(_inst dillo)" "$dillo_state" \ "elinks" "Text-mode web browser$(_inst elinks)" "$elinks_state" \ diff --git a/modules/extras/programming/programming.sh b/modules/extras/programming/programming.sh index bff378c..18e58f2 100644 --- a/modules/extras/programming/programming.sh +++ b/modules/extras/programming/programming.sh @@ -23,7 +23,7 @@ _cat_programming() { local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6)) local choices choices=$(whiptail --title "Programming Applications" --checklist \ - "Select editors and IDEs (12 items, ↑↓ scroll):" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ + "Select editors and IDEs${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ "vim" "Classic terminal editor$(_inst vim)" "$vim_state" \ "vim-gtk3" "Vim with GTK3 GUI$(_inst vim-gtk3)" "$vimgtk_state" \ "neovim" "Modern vim fork$(_inst neovim)" "$neovim_state" \ diff --git a/modules/extras/security/security.sh b/modules/extras/security/security.sh index 8b92029..927148b 100644 --- a/modules/extras/security/security.sh +++ b/modules/extras/security/security.sh @@ -14,7 +14,7 @@ _cat_security() { local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6)) local choices choices=$(whiptail --title "Security & Networking" --checklist \ - "Select security and networking tools (6 items):" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ + "Select security and networking tools${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ "wireshark" "Network protocol analyzer (GUI)$(_inst wireshark)" "$wireshark_state" \ "tcpdump" "Command-line packet analyzer$(_inst tcpdump)" "$tcpdump_state" \ "zenmap" "Network scanner GUI (Nmap frontend)$(_inst zenmap)" "$zenmap_state" \ diff --git a/modules/extras/system/software_centers.sh b/modules/extras/system/software_centers.sh index f1af513..2f37d56 100644 --- a/modules/extras/system/software_centers.sh +++ b/modules/extras/system/software_centers.sh @@ -6,8 +6,8 @@ _cat_software_centers() { local sc_choice sc_choice=$(whiptail --title "Software Centers" --menu \ "Choose a software store to install:" 12 65 2 \ - "gnome-software" "Software Center for GNOME" \ - "plasma-discover" "Software manager for Plasma" \ + "gnome-software" "Software Center for GNOME$(_inst gnome-software)" \ + "plasma-discover" "Software manager for Plasma$(_inst plasma-discover)" \ 3>&1 1>&2 2>&3) [ -z "$sc_choice" ] && return diff --git a/modules/extras/system/system.sh b/modules/extras/system/system.sh index 1b8a200..b0456ff 100644 --- a/modules/extras/system/system.sh +++ b/modules/extras/system/system.sh @@ -57,11 +57,12 @@ _cat_general() { local timeshift_state; timeshift_state=$(_state "timeshift") local tmux_state; tmux_state=$(_state "tmux") local wine_state; wine_state=$(_state "wine") + local nvme_state; nvme_state=$(_state "nvme-cli") local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6)) local choices choices=$(whiptail --title "System Tools" --checklist \ - "Select system utilities to install (28 items, ↑↓ scroll):" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ + "Select system utilities to install${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \ "alacritty" "GPU-accelerated terminal$(_inst alacritty)" "$alacritty_state" \ "btop" "Resource monitor (fancy top)$(_inst btop)" "$btop_state" \ "compress" "Compression tools (zip, unrar, 7z)$(_inst zip)" "$compress_state" \ @@ -84,6 +85,7 @@ _cat_general() { "kvm" "QEMU/KVM virtualization$(_inst virt-manager)" "$kvm_state" \ "lshw" "List hardware details$(_inst lshw)" "$lshw_state" \ "mc" "Midnight Commander (file manager)$(_inst mc)" "$mc_state" \ + "nvme-cli" "NVMe SSD health monitoring$(_inst nvme-cli)" "$nvme_state" \ "nala" "APT frontend (parallel downloads)$(_inst nala)" "$nala_state" \ "ncdu" "Disk usage analyzer (ncurses)$(_inst ncdu)" "$ncdu_state" \ "psensor" "Hardware temperature monitor$(_inst psensor)" "$psensor_state" \ @@ -209,6 +211,28 @@ _cat_general() { echo "Wine already installed." fi ;; + nvme-cli) + if ! lsblk -d -o TRAN 2>/dev/null | grep -q "^nvme$"; then + echo "No NVMe controller detected. Skipping." + break + fi + if ! is_installed "nvme-cli"; then + _run_cmd "nvme-cli" "sudo apt install -y nvme-cli" "Installing nvme-cli..." + fi + local nvme_dev + nvme_dev=$(lsblk -d -o NAME,TRAN 2>/dev/null | awk '/nvme/ {print $1; exit}') + if [ -n "$nvme_dev" ] && [ -e "/dev/${nvme_dev}" ]; then + if _confirm "NVMe Health" "Run smart-log on /dev/${nvme_dev}?"; then + echo "" + sudo nvme smart-log "/dev/${nvme_dev}" + echo "" + echo "Press [ENTER] to continue..." + read -r + fi + else + echo "No NVMe device found for health check." + fi + ;; *) if $headless; then echo "Skipping $pkg (headless mode)" diff --git a/modules/extras/themes/cursors/cursors.sh b/modules/extras/themes/cursors/cursors.sh index baac2ef..ede36b7 100644 --- a/modules/extras/themes/cursors/cursors.sh +++ b/modules/extras/themes/cursors/cursors.sh @@ -11,7 +11,7 @@ _cat_cursors() { local choices choices=$(whiptail --title "Cursor Themes" --checklist \ - "Select cursor themes to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select cursor themes to install${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "bibata-cursor-theme" "Bibata cursors$(_inst bibata-cursor-theme)" "$bibata_state" \ "breeze-cursor-theme" "Breeze cursors (KDE)$(_inst breeze-cursor-theme)" "$breeze_state" \ "chameleon-cursor-theme" "Chameleon cursors$(_inst chameleon-cursor-theme)" "$chameleon_state" \ diff --git a/modules/extras/themes/desktop-themes/desktop-themes.sh b/modules/extras/themes/desktop-themes/desktop-themes.sh index 809c9e4..5f44528 100644 --- a/modules/extras/themes/desktop-themes/desktop-themes.sh +++ b/modules/extras/themes/desktop-themes/desktop-themes.sh @@ -14,7 +14,7 @@ _cat_themes() { local choices choices=$(whiptail --title "Desktop Themes (GTK/KDE)" --checklist \ - "Select desktop themes to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select desktop themes to install${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "arc-theme" "Arc GTK theme$(_inst arc-theme)" "$arc_state" \ "blackbird-gtk-theme" "Blackbird GTK theme$(_inst blackbird-gtk-theme)" "$blackbird_state" \ "bluebird-gtk-theme" "Bluebird GTK theme$(_inst bluebird-gtk-theme)" "$bluebird_state" \ diff --git a/modules/extras/themes/fonts/fonts.sh b/modules/extras/themes/fonts/fonts.sh index 06cf0de..2043533 100644 --- a/modules/extras/themes/fonts/fonts.sh +++ b/modules/extras/themes/fonts/fonts.sh @@ -13,7 +13,7 @@ _cat_fonts() { local choices choices=$(whiptail --title "Fonts" --checklist \ - "Select fonts to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select fonts to install${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "fonts-bebas-neue" "Bebas Neue (display)$(_inst fonts-bebas-neue)" "$bebas_state" \ "fonts-anonymous-pro" "Anonymous Pro (monospace)$(_inst fonts-anonymous-pro)" "$anon_state" \ "fonts-adf-verana" "ADF Verana (sans-serif)$(_inst fonts-adf-verana)" "$verana_state" \ diff --git a/modules/extras/themes/icons/icons.sh b/modules/extras/themes/icons/icons.sh index 9a5914a..e8d345b 100644 --- a/modules/extras/themes/icons/icons.sh +++ b/modules/extras/themes/icons/icons.sh @@ -42,7 +42,7 @@ _cat_icons() { local choices choices=$(whiptail --title "Icon Themes" --checklist \ - "Select icon themes to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select icon themes to install${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "${items[@]}" \ 3>&1 1>&2 2>&3) clear diff --git a/modules/gaming.sh b/modules/gaming.sh index 8e08e4d..957f7d0 100644 --- a/modules/gaming.sh +++ b/modules/gaming.sh @@ -123,13 +123,14 @@ install_gaming() { # 2. Gaming packages checklist local choices choices=$(whiptail --title "Gaming Setup" --checklist \ - "Select gaming packages to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ + "Select gaming packages to install${SCROLL_HINT}:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \ "steam" "Steam (requires 32-bit support)" ON \ "gamemode" "Game performance optimization" ON \ "mangohud" "Performance overlay (Vulkan/OpenGL)" ON \ "heroic" "Heroic Launcher (Epic/GOG)" OFF \ "java-jre" "Java Runtimes (8, 17, 21)" OFF \ "goverlay" "MangoHud config GUI" ON \ + "openrgb" "OpenRGB (RGB lighting control)$(_inst openrgb)" OFF \ "lutris" "Game launcher/manager" OFF \ 3>&1 1>&2 2>&3) @@ -162,6 +163,13 @@ install_gaming() { mangohud) install_mangohud ;; gamemode) install_gamemode ;; goverlay) install_goverlay ;; + openrgb) + if [ "$DEBIAN_VERSION" = "11" ]; then + echo "OpenRGB requires Debian 12+." + continue + fi + install_openrgb + ;; lutris) install_lutris ;; *) _run_install "$pkg" ;; esac diff --git a/modules/gaming/tools.sh b/modules/gaming/tools.sh index b89a451..18bec42 100644 --- a/modules/gaming/tools.sh +++ b/modules/gaming/tools.sh @@ -20,3 +20,44 @@ install_goverlay() { install_lutris() { _run_install lutris } + +install_openrgb() { + local url + if [ "$DEBIAN_VERSION" = "12" ]; then + url="https://codeberg.org/OpenRGB/OpenRGB/releases/download/release_candidate_1.0rc2/openrgb_1.0rc2_amd64_bookworm_0fca93e.deb" + elif [ "$DEBIAN_VERSION" = "13" ]; then + url="https://codeberg.org/OpenRGB/OpenRGB/releases/download/release_candidate_1.0rc2/openrgb_1.0rc2_amd64_trixie_0fca93e.deb" + else + echo "OpenRGB requires Debian 12 (Bookworm) or 13 (Trixie)." + return 1 + fi + + local deb_path="/tmp/openrgb.deb" + local ua="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" + + _run_cmd "OpenRGB" "curl -L -o ${deb_path} -A '${ua}' '${url}'" "Downloading OpenRGB..." + + if [ ! -s "${deb_path}" ]; then + echo -e "${RED}[-]${NC} Download failed: empty or missing file." + rm -f "${deb_path}" + return 1 + fi + + echo -e "${GREEN}[+]${NC} Installing OpenRGB package..." + if ! sudo apt install -y "${deb_path}"; then + rm -f "${deb_path}" + echo -e "${RED}[-]${NC} Package installation failed." + return 1 + fi + + sudo modprobe i2c-dev + if ! grep -q "^i2c-dev" /etc/modules 2>/dev/null; then + echo "i2c-dev" | sudo tee -a /etc/modules >/dev/null + fi + sudo usermod -aG i2c "$USER" + sudo udevadm control --reload-rules && sudo udevadm trigger + sudo setcap cap_sys_rawio=ep /usr/bin/openrgb 2>/dev/null || true + + rm -f "${deb_path}" + echo -e "${GREEN}OpenRGB installed. NOTE: You must reboot or log out/in for the 'i2c' group to take effect.${NC}" +} diff --git a/modules/gpu.sh b/modules/gpu.sh index f13eba0..ddbd34a 100644 --- a/modules/gpu.sh +++ b/modules/gpu.sh @@ -10,7 +10,6 @@ source "${_GPU_DIR}/nvidia.sh" NVIDIA_DRIVER_MODE="" install_gpu_drivers() { - # Step 1: Info banner local info="This section installs the latest Mesa graphics stack\n" info+="from Debian backports (or stable), plus GPU firmware\n" info+="and monitoring tools tailored to your hardware.\n\n" @@ -26,9 +25,8 @@ install_gpu_drivers() { return fi - # Step 2: GPU detected? + # ── Unknown GPU / VM block ── if [ "$GPU_TYPE" = "unknown" ] || [ -z "$GPU_TYPE" ]; then - # --- BLOQUE B: No GPU / VM (inline, no _install_mesa_backports) --- local mesa_pkgs=(mesa-vulkan-drivers libgl1-mesa-dri libglx-mesa0 libegl-mesa0 mesa-va-drivers) local ref_ver ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}') @@ -63,94 +61,94 @@ install_gpu_drivers() { fi fi offer_generic_tools - else - # --- BLOQUE A: GPU detectada (AMD / Intel / NVIDIA) --- - local ref_ver - ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}') - local ref_bpo_ver - ref_bpo_ver=$(apt-cache madison mesa-vulkan-drivers 2>/dev/null | \ - grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) - local comp_line="Components: Vulkan, OpenGL, GLX, EGL, VA-API (64-bit)" + echo -e "${GREEN}Graphics stack setup complete.${NC}" + return + fi - local src_line="Source: Debian Stable" - [ -n "$ref_bpo_ver" ] && [ "$(is_backports_enabled)" == "true" ] && src_line="Source: Debian ${DEBIAN_CODENAME^}-Backports" + # ── Detectable GPU: build plan ── + local ref_ver + ref_ver=$(apt-cache policy mesa-vulkan-drivers 2>/dev/null | awk 'NR==3 {print $2; exit}') + local ref_bpo_ver + ref_bpo_ver=$(apt-cache madison mesa-vulkan-drivers 2>/dev/null | \ + grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1) + local comp_line="Components: Vulkan, OpenGL, GLX, EGL, VA-API (64-bit)" - local plan="GPU detected: ${GPU_DESC}\n\n" - plan+="${src_line}\n" - plan+="Mesa ${ref_bpo_ver:-$ref_ver}\n" - plan+="${comp_line}\n" + local src_line="Source: Debian Stable" + [ -n "$ref_bpo_ver" ] && [ "$(is_backports_enabled)" == "true" ] && src_line="Source: Debian ${DEBIAN_CODENAME^}-Backports" - case "$GPU_TYPE" in - amd) plan+="[+] Firmware: firmware-amd-graphics\n" ;; - intel) - local _gen; _gen=$(get_intel_generation) - local _va; [ "$_gen" = "gen7-" ] && _va="i965-va-driver-shaders" || _va="intel-media-va-driver-non-free" - plan+="[+] Firmware: firmware-intel-graphics + ${_va}\n" - ;; - nvidia) plan+="[+] NVIDIA driver (details in next step)\n" ;; - esac + local plan="GPUs detected: ${GPU_DESC}\n\n" + plan+="${src_line}\n" + plan+="Mesa ${ref_bpo_ver:-$ref_ver}\n" + plan+="${comp_line}\n\n" + plan+="Components:\n" + if $HAS_INTEL; then + local _gen; _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" + fi + if $HAS_AMD; then + plan+=" [+] AMD firmware (firmware-amd-graphics)\n" + fi + if $HAS_NVIDIA; then + plan+=" [+] NVIDIA driver (details in next step)\n" + fi - if ! _confirm "Graphics Stack — ${GPU_DESC}" "$plan" 14 70; then - echo "Skipping Graphics Stack." - return - fi + if ! _confirm "Graphics Stack — ${GPU_DESC}" "$plan" 14 70; then + echo "Skipping Graphics Stack." + return + fi - # 3. _run_cmd (via vendor functions — each with its own pkg_versions + _confirm) - case "$GPU_TYPE" in - amd) install_amd_firmware ;; - intel) install_intel_firmware ;; - nvidia) - if [ "$DEBIAN_VERSION" = "11" ]; then - # Bullseye: solo Fermi check, resto → nvidia-driver directo - if type install_nvidia_bullseye &>/dev/null; then - install_nvidia_bullseye - else - install_nvidia_driver - fi - elif [ "$DEBIAN_VERSION" = "12" ]; then - # Bookworm: Kepler intercepción → legacy, sin nvidia-detect - if [ "$(is_nvidia_kepler)" = "true" ]; then - if type _install_nvidia_bookworm_kepler &>/dev/null; then - _install_nvidia_bookworm_kepler - else - install_nvidia_driver - fi - else - install_nvidia_driver - fi - elif [ "$DEBIAN_VERSION" = "13" ]; then - # Trixie: Kepler → advertencia Nouveau, sin driver - if [ "$(is_nvidia_kepler)" = "true" ]; then - _msg "NVIDIA Kepler — Trixie" \ - "Su GPU es arquitectura Kepler (GKxxx).\n\n\ -Los drivers privativos NVIDIA para Kepler (rama 470)\n\ -NO están disponibles en Debian 13 (Trixie).\n\n\ -Se recomienda usar el driver libre Nouveau:\n\ - - Soporte básico de display\n\ - - Sin aceleración 3D completa\n\ - - Sin Optimus/PRIME\n\n\ -Si necesita driver privativo, use Debian 12 (Bookworm)\n\ -con nvidia-legacy-470xx-driver." 16 70 - NVIDIA_DRIVER_MODE="" - return 1 - else - install_nvidia_driver - fi + # ── Sequential firmware / driver installs ── + if $HAS_INTEL; then + install_intel_firmware + fi + + if $HAS_AMD; then + install_amd_firmware + fi + + if $HAS_NVIDIA; then + if [ "$DEBIAN_VERSION" = "11" ]; then + if type install_nvidia_bullseye &>/dev/null; then + install_nvidia_bullseye + else + install_nvidia_driver + fi + elif [ "$DEBIAN_VERSION" = "12" ]; then + if [ "$(is_nvidia_kepler)" = "true" ]; then + if type _install_nvidia_bookworm_kepler &>/dev/null; then + _install_nvidia_bookworm_kepler else install_nvidia_driver fi - ;; - esac + else + install_nvidia_driver + fi + elif [ "$DEBIAN_VERSION" = "13" ]; then + if [ "$(is_nvidia_kepler)" = "true" ]; then + _msg "NVIDIA Kepler — Trixie" \ + "Your GPU is NVIDIA Kepler architecture.\nThe nvidia-tesla-470 driver is not available\nin Debian 13 (Trixie).\n\nNo NVIDIA driver will be installed for this GPU.\nOther GPUs (Intel/AMD) will still be configured." + NVIDIA_DRIVER_MODE="" + else + install_nvidia_driver + fi + else + install_nvidia_driver + fi + fi - # Mesa (backports / stable) - _install_mesa_backports + # ── Mesa (once) ── + _install_mesa_backports - # Vendor-specific tools - case "$GPU_TYPE" in - amd) offer_amd_tools ;; - intel) offer_intel_tools ;; - nvidia) offer_generic_tools ;; - esac + # ── Vendor-specific tools ── + if $HAS_INTEL; then + offer_intel_tools + fi + if $HAS_AMD; then + offer_amd_tools + fi + if $HAS_NVIDIA; then + offer_generic_tools fi echo -e "${GREEN}Graphics stack setup complete.${NC}" diff --git a/modules/utils.sh b/modules/utils.sh index 9648cce..5370cd2 100644 --- a/modules/utils.sh +++ b/modules/utils.sh @@ -4,6 +4,7 @@ # ------------------ # Global variables # ------------------ +readonly SCROLL_HINT=" [↑↓]" CPU_SUMMARY="" RAM_SUMMARY="" GPU_TYPE="" @@ -11,6 +12,9 @@ GPU_DESC="" GPU_VERSION="" INTEL_GPU_DEVICE_ID="" NVIDIA_GPU_DEVICE_ID="" +HAS_NVIDIA=false +HAS_AMD=false +HAS_INTEL=false KERNEL_VERSION="" WIFI_CHIPSET="" @@ -170,28 +174,49 @@ detect_kernel() { # GPU detection # ---------------------------------- detect_gpu() { - local gpu_line - gpu_line=$(lspci -nn | grep -E "VGA|3D" | head -n1) || true - if [ -z "$gpu_line" ]; then + local gpu_lines + gpu_lines=$(lspci -nn | grep -E "VGA|3D") || true + if [ -z "$gpu_lines" ]; then GPU_TYPE="unknown" GPU_DESC="No GPU detected" return fi + local has_nvidia=false has_amd=false has_intel=false + local desc_lines="" nvidia_dev_id="" intel_dev_id="" - GPU_DESC=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//') + while IFS= read -r line; do + local desc + desc=$(echo "$line" | sed -E 's/.*: //; s/ *\(rev.*//') + [ -n "$desc_lines" ] && desc_lines+=" + " + desc_lines+="$desc" - if echo "$gpu_line" | grep -qi "AMD"; then - GPU_TYPE="amd" - elif echo "$gpu_line" | grep -qi "Intel"; then - GPU_TYPE="intel" - INTEL_GPU_DEVICE_ID=$(echo "$gpu_line" | grep -oP '8086:\K[0-9a-fA-F]+' | head -n1) - if [ -n "$INTEL_GPU_DEVICE_ID" ]; then - INTEL_GPU_DEVICE_ID="0x${INTEL_GPU_DEVICE_ID,,}" + if echo "$line" | grep -qi "nvidia"; then + has_nvidia=true + [ -z "$nvidia_dev_id" ] && nvidia_dev_id=$(echo "$line" | grep -oP '10de:\K[0-9a-fA-F]+' | head -n1) + elif echo "$line" | grep -qi "amd"; then + has_amd=true + elif echo "$line" | grep -qi "intel"; then + has_intel=true + [ -z "$intel_dev_id" ] && intel_dev_id=$(echo "$line" | grep -oP '8086:\K[0-9a-fA-F]+' | head -n1) fi - elif echo "$gpu_line" | grep -qi "NVIDIA"; then + done <<< "$gpu_lines" + + GPU_DESC="$desc_lines" + HAS_NVIDIA=$has_nvidia + HAS_AMD=$has_amd + HAS_INTEL=$has_intel + + if $has_nvidia; then GPU_TYPE="nvidia" - NVIDIA_GPU_DEVICE_ID=$(echo "$gpu_line" | grep -oP '10de:\K[0-9a-fA-F]+' | head -n1) + [ -n "$nvidia_dev_id" ] && NVIDIA_GPU_DEVICE_ID="$nvidia_dev_id" + elif $has_amd; then + GPU_TYPE="amd" + elif $has_intel; then + GPU_TYPE="intel" + if [ -n "$intel_dev_id" ]; then + INTEL_GPU_DEVICE_ID="0x${intel_dev_id,,}" + fi else GPU_TYPE="unknown" fi