Add files via upload

update
This commit is contained in:
stornic56
2026-05-23 22:50:36 -05:00
committed by GitHub
parent 43ae3e55a4
commit eec16d0c83
10 changed files with 377 additions and 347 deletions
+68 -101
View File
@@ -1,132 +1,99 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Debianito # Debianito — simple configurator script
set -euo pipefail set -euo pipefail
RED='\033[0;31m' RED='\033[0;31m'
GREEN='\033[0;32m' GREEN='\033[0;32m'
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
NC='\033[0m' NC='\033[0m'
# ------------------- # TUI dimensions — fixed centered size for whiptail dialogs
# Load modules TUI_ALTO=20
# ----------------- TUI_ANCHO=78
TUI_ALTO_LISTA=10
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 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"
source "${MODULES_DIR}/sudo_config.sh" source "${MODULES_DIR}/sudo_config.sh"
source "${MODULES_DIR}/repos.sh" source "${MODULES_DIR}/repos.sh"
if [ -f "${MODULES_DIR}/firmware.sh" ]; then [ -f "${MODULES_DIR}/firmware.sh" ] && source "${MODULES_DIR}/firmware.sh"
source "${MODULES_DIR}/firmware.sh" [ -f "${MODULES_DIR}/gpu.sh" ] && source "${MODULES_DIR}/gpu.sh"
fi [ -f "${MODULES_DIR}/kernel.sh" ] && source "${MODULES_DIR}/kernel.sh"
if [ -f "${MODULES_DIR}/gpu.sh" ]; then [ -f "${MODULES_DIR}/gaming.sh" ] && source "${MODULES_DIR}/gaming.sh"
source "${MODULES_DIR}/gpu.sh" [ -f "${MODULES_DIR}/extras.sh" ] && source "${MODULES_DIR}/extras.sh"
fi [ -f "${MODULES_DIR}/zram.sh" ] && source "${MODULES_DIR}/zram.sh"
if [ -f "${MODULES_DIR}/kernel.sh" ]; then
source "${MODULES_DIR}/kernel.sh"
fi
if [ -f "${MODULES_DIR}/gaming.sh" ]; then
source "${MODULES_DIR}/gaming.sh"
fi
if [ -f "${MODULES_DIR}/extras.sh" ]; then
source "${MODULES_DIR}/extras.sh"
fi
if [ -f "${MODULES_DIR}/zram.sh" ]; then
source "${MODULES_DIR}/zram.sh"
fi
# --------------------------
# Global state
# --------------------------
REPOS_CONFIGURED=false REPOS_CONFIGURED=false
DEBIAN_VERSION="" DEBIAN_VERSION=""
DEBIAN_CODENAME="" DEBIAN_CODENAME=""
# ---------------------------------
# Pause helper
# ---------------------------------
pause() {
echo ""
read -p "Press Enter to continue..."
}
# ---------------------------------
# menu
# ---------------------------------
if ! echo "╔" | grep -q "t"; then
BOX_DRAWING=false
else
BOX_DRAWING=true
fi
main_menu() { main_menu() {
PS3="Select an option (1-9): " # Auto-adjust TUI dimensions for small terminals
options=( if [ "$LINES" -lt $((TUI_ALTO + 6)) ] || [ "$COLUMNS" -lt $((TUI_ANCHO + 6)) ]; then
"User Privileges & Feedback" TUI_ALTO=$((LINES - 4 > 8 ? LINES - 4 : 8))
"Configure repositories" TUI_ANCHO=$((COLUMNS - 4 > 50 ? COLUMNS - 4 : 50))
"Setup Wireless & Firmware" TUI_ALTO_LISTA=$((TUI_ALTO - 10 > 4 ? TUI_ALTO - 10 : 4))
"Configure Graphics Stack and Tools" fi
"Update Kernel to Backports"
"Gaming Setup and Performance"
"Install ZRAM (compressed swap)"
"Install extra applications"
"Exit"
)
while true; do while true; do
echo "" local choice
printf "${RED}╔═══════════════════════════════╗\n" >&2 choice=$(whiptail --title "DEBIANITO — simple configurator script" --menu "" \
printf "║ DEBIANITO ║\n" >&2 $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
printf "║ Debian Post-Install Setup ║\n" >&2 "1" "System Info" \
printf "╚═══════════════════════════════╝\n${NC}" >&2 "2" "User Privileges & Feedback" \
"3" "Configure repositories" \
"4" "Wireless & Firmware" \
"5" "Graphics Stack" \
"6" "Backports Kernel" \
"7" "Gaming Setup" \
"8" "ZRAM (Swap)" \
"9" "Install Programs and Software" \
"10" "Exit" \
3>&1 1>&2 2>&3)
echo -e "\033[1;97m║─────────── SYSTEM INFO ─────┤\n${NC}\033[0m" clear
echo "Detected: Debian ${DEBIAN_VERSION} (${DEBIAN_CODENAME})"
echo "Kernel: ${KERNEL_VERSION}"
echo "CPU: $(get_cpu_summary)"
echo "RAM: $(get_ram_summary)"
if [ -n "$GPU_VERSION" ]; then
echo "GPU: ${GPU_DESC} (${GPU_VERSION})"
else
echo "GPU: ${GPU_DESC}"
fi
if [ -n "$ETH_DESC" ] && [ -n "$WIFI_DESC" ]; then
echo "Network:"
echo " Ethernet: ${ETH_DESC}"
echo " WiFi: ${WIFI_DESC}"
elif [ -n "$ETH_DESC" ]; then
echo "Network: ${ETH_DESC}"
elif [ -n "$WIFI_DESC" ]; then
echo "Network: ${WIFI_DESC}"
else
echo "Network: No adapters detected"
fi
echo ""
select opt in "${options[@]}"; do case "$choice" in
case $REPLY in 1) _show_sysinfo ;;
1) config_sudo || true ;; 2) config_sudo || true ;;
2) configure_repos || true ;; 3) configure_repos || true ;;
3) install_firmware || true ;; 4) install_firmware || true ;;
4) install_gpu_drivers || true ;; 5) install_gpu_drivers || true ;;
5) install_kernel_backports || true ;; 6) install_kernel_backports || true ;;
6) install_gaming || true ;; 7) install_gaming || true ;;
7) install_zram || true ;; 8) install_zram || true ;;
8) install_extras || true ;; 9) install_extras || true ;;
9) echo "Exiting."; exit 0 ;; 10) echo "Exiting."; exit 0 ;;
*) echo "Invalid choice. Please try again." ;;
esac esac
[ "$REPLY" != "9" ] && [ "$REPLY" != "" ] && pause
break
done
done done
} }
# ---------------- _show_sysinfo() {
# Pre-run checks local gpu_info="${GPU_DESC}"
# ---------------- [ -n "$GPU_VERSION" ] && gpu_info+=" (${GPU_VERSION})"
local network_info
if [ -n "$ETH_DESC" ] && [ -n "$WIFI_DESC" ]; then
network_info="Ethernet: ${ETH_DESC}\nWiFi: ${WIFI_DESC}"
elif [ -n "$ETH_DESC" ]; then
network_info="${ETH_DESC}"
elif [ -n "$WIFI_DESC" ]; then
network_info="${WIFI_DESC}"
else
network_info="No adapters detected"
fi
_msg "System Information" \
"Debian: ${DEBIAN_VERSION} (${DEBIAN_CODENAME})
Kernel: ${KERNEL_VERSION}
CPU: $(get_cpu_summary)
RAM: $(get_ram_summary)
GPU: ${gpu_info}
Network: ${network_info}" 13 65
}
check_root check_root
check_sudo check_sudo
+144 -108
View File
@@ -15,68 +15,60 @@ install_extras() {
fetch_pkg="fastfetch" fetch_pkg="fastfetch"
fi fi
! command -v dialog &>/dev/null && sudo apt install -y dialog 2>/dev/null || true if _is_headless; then
_msg "Headless Mode" "No graphical display detected.\n\nOnly terminal-friendly packages will be shown.\nGUI applications (browsers, media players, design tools)\nwill be skipped automatically." 12 60
if dialog --title "Quick Install" --yesno \
"Install recommended tools?\n\n - Compression tools (zip, unzip, rar, 7z)\n - ${fetch_pkg} (system info)\n - htop (process viewer)\n - VLC (media player)\n - inxi (system information)\n - Microsoft fonts (Times New Roman, Arial)\n\n[Yes - Quick Install] [No - Select individually]" 16 65; then
echo "Installing recommended tools..."
local quick_pkgs=()
! is_installed "zip" && quick_pkgs+=("zip")
! is_installed "unzip" && quick_pkgs+=("unzip")
! is_installed "rar" && quick_pkgs+=("rar")
! is_installed "unrar" && quick_pkgs+=("unrar")
! is_installed "p7zip-full" && quick_pkgs+=("p7zip-full")
! is_installed "p7zip-rar" && quick_pkgs+=("p7zip-rar")
! is_installed "$fetch_pkg" && quick_pkgs+=("$fetch_pkg")
! is_installed "htop" && quick_pkgs+=("htop")
! is_installed "vlc" && quick_pkgs+=("vlc")
! is_installed "inxi" && quick_pkgs+=("inxi")
! is_installed "ttf-mscorefonts-installer" && quick_pkgs+=("ttf-mscorefonts-installer")
if [ ${#quick_pkgs[@]} -gt 0 ]; then
sudo apt install -y "${quick_pkgs[@]}"
else
echo "All recommended tools are already installed."
fi
echo -e "${GREEN}Recommended tools installed.${NC}"
return
fi fi
while true; do while true; do
local cat_choice local cat_choice
cat_choice=$(dialog --title "Extra Software" --menu \ cat_choice=$(whiptail --title "Extra Software" --menu \
"Select a category:" 20 68 9 \ "Select a category:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"0" "Essential Pack" \
"1" "System Tools" \ "1" "System Tools" \
"2" "Development & Servers" \ "2" "Development & Servers" \
"3" "Media Players" \ "3" "Media Players" \
"4" "Web Browsers" \ "4" "Web Browsers" \
"5" "GTK Themes" \ "5" "Customization System" \
"6" "Icon Themes" \ "6" "Fetch / System Info" \
"7" "Fetch / System Info" \ "7" "Download & Network" \
"8" "Download & Network" \ "8" "Multimedia & Design" \
"9" "Multimedia & Design" \ "9" "Back to main menu" \
"10" "Back to main menu" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
[ -z "$cat_choice" ] && return [ -z "$cat_choice" ] && return
tput reset 2>/dev/null || clear clear
case "$cat_choice" in case "$cat_choice" in
0) _quick_install ;;
1) _cat_general ;; 1) _cat_general ;;
2) _cat_dev ;; 2) _cat_dev ;;
3) _cat_players ;; 3) _cat_players ;;
4) _cat_browsers ;; 4) _cat_browsers ;;
5) _cat_themes ;; 5) _cat_customization ;;
6) _cat_icons ;; 6) _cat_fetch ;;
7) _cat_fetch ;; 7) _cat_download ;;
8) _cat_download ;; 8) _cat_design ;;
9) _cat_design ;; 9) return ;;
10) return ;;
esac esac
clear clear
done done
} }
_quick_install() {
_msg "Essential Pack" \
"Install basic programs:\n\n - Compression (zip, unrar, 7z)\n - System tools (htop, inxi, fastfetch)\n - VLC media player\n - Microsoft fonts" 13 60
local quick_pkgs=(
zip unzip rar unrar p7zip-full p7zip-rar
"$fetch_pkg" htop vlc inxi ttf-mscorefonts-installer
)
_run_install_batch "${quick_pkgs[@]}"
echo -e "${GREEN}Essential Pack installed.${NC}"
}
_cat_general() { _cat_general() {
local headless=false
_is_headless && headless=true
local alacritty_state="OFF"; is_installed "alacritty" && alacritty_state="ON" local alacritty_state="OFF"; is_installed "alacritty" && alacritty_state="ON"
local btop_state="OFF"; is_installed "btop" && btop_state="ON" local btop_state="OFF"; is_installed "btop" && btop_state="ON"
local compress_state="OFF"; is_installed "zip" && is_installed "unzip" && is_installed "p7zip-full" && compress_state="ON" local compress_state="OFF"; is_installed "zip" && is_installed "unzip" && is_installed "p7zip-full" && compress_state="ON"
@@ -104,9 +96,10 @@ _cat_general() {
local tmux_state="OFF"; is_installed "tmux" && tmux_state="ON" local tmux_state="OFF"; is_installed "tmux" && tmux_state="ON"
local ttf_state="OFF"; is_installed "ttf-mscorefonts-installer" && ttf_state="ON" local ttf_state="OFF"; is_installed "ttf-mscorefonts-installer" && ttf_state="ON"
local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6))
local choices local choices
choices=$(dialog --title "System Tools" --checklist \ choices=$(whiptail --title "System Tools" --checklist \
"Select system utilities to install:" 30 72 26 \ "Select system utilities to install (26 items, ↑↓ scroll):" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \
"alacritty" "GPU-accelerated terminal$(_inst alacritty)" "$alacritty_state" \ "alacritty" "GPU-accelerated terminal$(_inst alacritty)" "$alacritty_state" \
"btop" "Resource monitor (fancy top)$(_inst btop)" "$btop_state" \ "btop" "Resource monitor (fancy top)$(_inst btop)" "$btop_state" \
"compress" "Compression tools (zip, unrar, 7z)$(_inst zip)" "$compress_state" \ "compress" "Compression tools (zip, unrar, 7z)$(_inst zip)" "$compress_state" \
@@ -151,8 +144,7 @@ _cat_general() {
! 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
echo "Installing compression utilities..." _run_install_batch "${need[@]}"
sudo apt install -y "${need[@]}"
echo -e "${GREEN}Compression utilities installed.${NC}" echo -e "${GREEN}Compression utilities installed.${NC}"
fi fi
;; ;;
@@ -161,21 +153,19 @@ _cat_general() {
! 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
echo "Installing HTTP tools..." _run_install_batch "${need[@]}"
sudo apt install -y "${need[@]}"
else else
echo "curl and wget already installed." echo "curl and wget already installed."
fi fi
;; ;;
flatpak) flatpak)
if ! is_installed "flatpak"; then if ! is_installed "flatpak"; then
echo "Installing Flatpak..." _run_cmd "Flatpak" "sudo apt install -y flatpak" "Installing Flatpak..."
sudo apt install -y flatpak
if command -v plasma-discover &>/dev/null; then if command -v plasma-discover &>/dev/null; then
sudo apt install -y plasma-discover-backend-flatpak _run_cmd "Flatpak" "sudo apt install -y plasma-discover-backend-flatpak" "Installing Flatpak backend..."
echo "Flatpak backend for Discover installed." echo "Flatpak backend for Discover installed."
elif command -v gnome-software &>/dev/null; then elif command -v gnome-software &>/dev/null; then
sudo apt install -y gnome-software-plugin-flatpak _run_cmd "Flatpak" "sudo apt install -y gnome-software-plugin-flatpak" "Installing Flatpak plugin..."
echo "Flatpak plugin for GNOME Software installed." echo "Flatpak plugin for GNOME Software installed."
fi fi
else else
@@ -188,9 +178,7 @@ _cat_general() {
;; ;;
kvm) kvm)
if ! is_installed "virt-manager"; then if ! is_installed "virt-manager"; then
echo "Installing QEMU/KVM virtualization..." _run_cmd "KVM" "sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager" "Installing KVM..."
sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system \
libvirt-clients bridge-utils virt-manager
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
echo -e "${GREEN}QEMU/KVM installed. A reboot is recommended.${NC}" echo -e "${GREEN}QEMU/KVM installed. A reboot is recommended.${NC}"
@@ -199,8 +187,12 @@ _cat_general() {
fi fi
;; ;;
*) *)
if $headless; then
echo "Skipping $pkg (headless mode)"
continue
fi
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -212,6 +204,8 @@ _cat_general() {
} }
_cat_dev() { _cat_dev() {
local headless=false
_is_headless && headless=true
local apache_state="OFF"; is_installed "apache2" && apache_state="ON" local apache_state="OFF"; is_installed "apache2" && apache_state="ON"
local build_state="OFF"; is_installed "build-essential" && build_state="ON" local build_state="OFF"; is_installed "build-essential" && build_state="ON"
local certbot_state="OFF"; is_installed "certbot" && certbot_state="ON" local certbot_state="OFF"; is_installed "certbot" && certbot_state="ON"
@@ -231,9 +225,9 @@ _cat_dev() {
local ufw_state="OFF"; is_installed "ufw" && ufw_state="ON" local ufw_state="OFF"; is_installed "ufw" && ufw_state="ON"
local zenmap_state="OFF"; is_installed "zenmap" && zenmap_state="ON" local zenmap_state="OFF"; is_installed "zenmap" && zenmap_state="ON"
local choices local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6))
choices=$(dialog --title "Development & Servers" --checklist \ choices=$(whiptail --title "Development & Servers" --checklist \
"Select development tools and servers:" 26 72 18 \ "Select development tools and servers (18 items, ↑↓ scroll):" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \
"apache2" "Apache web server$(_inst apache2)" "$apache_state" \ "apache2" "Apache web server$(_inst apache2)" "$apache_state" \
"build-essential" "C/C++ build tools (gcc, make)$(_inst build-essential)" "$build_state" \ "build-essential" "C/C++ build tools (gcc, make)$(_inst build-essential)" "$build_state" \
"certbot" "Let's Encrypt TLS certificates$(_inst certbot)" "$certbot_state" \ "certbot" "Let's Encrypt TLS certificates$(_inst certbot)" "$certbot_state" \
@@ -267,8 +261,7 @@ _cat_dev() {
! 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
echo "Installing Python 3 development tools..." _run_install_batch "${need[@]}"
sudo apt install -y "${need[@]}"
else else
echo "Python 3 tools already installed." echo "Python 3 tools already installed."
fi fi
@@ -278,8 +271,7 @@ _cat_dev() {
! 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
echo "Installing Docker..." _run_install_batch "${need[@]}"
sudo apt install -y "${need[@]}"
else else
echo "Docker already installed." echo "Docker already installed."
fi fi
@@ -289,7 +281,7 @@ _cat_dev() {
;; ;;
*) *)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -301,13 +293,16 @@ _cat_dev() {
} }
_cat_players() { _cat_players() {
local headless=false
_is_headless && headless=true
local handbrake_state="OFF"; is_installed "handbrake" && handbrake_state="ON" local handbrake_state="OFF"; is_installed "handbrake" && handbrake_state="ON"
local mpv_state="OFF"; is_installed "mpv" && mpv_state="ON" local mpv_state="OFF"; is_installed "mpv" && mpv_state="ON"
local vlc_state="OFF"; is_installed "vlc" && vlc_state="ON" local vlc_state="OFF"; is_installed "vlc" && vlc_state="ON"
local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6))
local choices local choices
choices=$(dialog --title "Media Players" --checklist \ choices=$(whiptail --title "Media Players" --checklist \
"Select media players:" 12 72 3 \ "Select media players:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \
"handbrake" "Video transcoder (DVD ripper)$(_inst handbrake)" "$handbrake_state" \ "handbrake" "Video transcoder (DVD ripper)$(_inst handbrake)" "$handbrake_state" \
"mpv" "Lightweight media player$(_inst mpv)" "$mpv_state" \ "mpv" "Lightweight media player$(_inst mpv)" "$mpv_state" \
"vlc" "VLC media player$(_inst vlc)" "$vlc_state" \ "vlc" "VLC media player$(_inst vlc)" "$vlc_state" \
@@ -319,8 +314,12 @@ _cat_players() {
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 $headless; then
echo "Skipping $pkg (headless mode)"
continue
fi
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -330,6 +329,8 @@ _cat_players() {
} }
_cat_browsers() { _cat_browsers() {
local headless=false
_is_headless && headless=true
local chromium_state="OFF"; is_installed "chromium" && chromium_state="ON" local chromium_state="OFF"; is_installed "chromium" && chromium_state="ON"
local dillo_state="OFF"; is_installed "dillo" && dillo_state="ON" local dillo_state="OFF"; is_installed "dillo" && dillo_state="ON"
local elinks_state="OFF"; is_installed "elinks" && elinks_state="ON" local elinks_state="OFF"; is_installed "elinks" && elinks_state="ON"
@@ -349,8 +350,8 @@ _cat_browsers() {
local w3m_state="OFF"; is_installed "w3m" && w3m_state="ON" local w3m_state="OFF"; is_installed "w3m" && w3m_state="ON"
local choices local choices
choices=$(dialog --title "Web Browsers" --checklist \ choices=$(whiptail --title "Web Browsers" --checklist \
"Select web browsers:" 24 72 14 \ "Select web browsers:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"chromium" "Chromium web browser$(_inst chromium)" "$chromium_state" \ "chromium" "Chromium web browser$(_inst chromium)" "$chromium_state" \
"dillo" "Lightweight graphical browser$(_inst dillo)" "$dillo_state" \ "dillo" "Lightweight graphical browser$(_inst dillo)" "$dillo_state" \
"elinks" "Text-mode web browser$(_inst elinks)" "$elinks_state" \ "elinks" "Text-mode web browser$(_inst elinks)" "$elinks_state" \
@@ -380,8 +381,8 @@ _cat_browsers() {
floorp) floorp)
if ! is_installed "floorp"; then if ! is_installed "floorp"; then
echo "Setting up Floorp repository..." echo "Setting up Floorp repository..."
! is_installed "curl" && sudo apt install -y curl ! is_installed "curl" && _run_install curl
! is_installed "gpg" && sudo apt install -y gpg ! is_installed "gpg" && _run_install gpg
sudo install -d -m 0755 /etc/apt/keyrings sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://ppa.floorp.app/KEY.gpg | \ curl -fsSL https://ppa.floorp.app/KEY.gpg | \
sudo gpg --dearmor -o /usr/share/keyrings/Floorp.gpg sudo gpg --dearmor -o /usr/share/keyrings/Floorp.gpg
@@ -392,8 +393,8 @@ Package: *
Pin: origin ppa.floorp.app Pin: origin ppa.floorp.app
Pin-Priority: 1000 Pin-Priority: 1000
EOF EOF
sudo apt update _run_cmd "APT Update" "sudo apt update" "Updating package lists..."
sudo apt install -y floorp _run_install floorp
echo -e "${GREEN}Floorp installed.${NC}" echo -e "${GREEN}Floorp installed.${NC}"
else else
echo "Floorp already installed." echo "Floorp already installed."
@@ -402,10 +403,10 @@ EOF
librewolf) librewolf)
if ! is_installed "librewolf"; then if ! is_installed "librewolf"; then
echo "Installing LibreWolf..." echo "Installing LibreWolf..."
sudo apt install -y extrepo _run_install extrepo
sudo extrepo enable librewolf 2>/dev/null || true sudo extrepo enable librewolf 2>/dev/null || true
sudo apt update _run_cmd "APT Update" "sudo apt update" "Updating package lists..."
sudo apt install -y librewolf _run_install librewolf
echo -e "${GREEN}LibreWolf installed.${NC}" echo -e "${GREEN}LibreWolf installed.${NC}"
else else
echo "LibreWolf already installed." echo "LibreWolf already installed."
@@ -418,15 +419,18 @@ EOF
! 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
echo "Installing w3m and dependencies..." _run_install_batch w3m w3m-img ca-certificates xsel
sudo apt install -y "${need[@]}"
else else
echo "w3m already installed." echo "w3m already installed."
fi fi
;; ;;
*) *)
if $headless; then
echo "Skipping $pkg (headless mode)"
continue
fi
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -437,7 +441,24 @@ EOF
echo -e "${GREEN}Web browsers installed.${NC}" echo -e "${GREEN}Web browsers installed.${NC}"
} }
_cat_customization() {
local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6))
local sub
sub=$(whiptail --title "Customization System" --menu \
"Select type:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \
"1" "GTK Themes" \
"2" "Icon Themes" \
3>&1 1>&2 2>&3)
[ -z "$sub" ] && return
case $sub in
1) _cat_themes ;;
2) _cat_icons ;;
esac
}
_cat_themes() { _cat_themes() {
local headless=false
_is_headless && headless=true
local arc_state="OFF"; is_installed "arc-theme" && arc_state="ON" local arc_state="OFF"; is_installed "arc-theme" && arc_state="ON"
local blackbird_state="OFF"; is_installed "blackbird-gtk-theme" && blackbird_state="ON" local blackbird_state="OFF"; is_installed "blackbird-gtk-theme" && blackbird_state="ON"
local bluebird_state="OFF"; is_installed "bluebird-gtk-theme" && bluebird_state="ON" local bluebird_state="OFF"; is_installed "bluebird-gtk-theme" && bluebird_state="ON"
@@ -447,8 +468,8 @@ _cat_themes() {
local orchis_state="OFF"; is_installed "orchis-gtk-theme" && orchis_state="ON" local orchis_state="OFF"; is_installed "orchis-gtk-theme" && orchis_state="ON"
local choices local choices
choices=$(dialog --title "GTK Themes" --checklist \ choices=$(whiptail --title "GTK Themes" --checklist \
"Select GTK themes to install:" 16 72 7 \ "Select GTK themes to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"arc-theme" "Arc GTK theme$(_inst arc-theme)" "$arc_state" \ "arc-theme" "Arc GTK theme$(_inst arc-theme)" "$arc_state" \
"blackbird-gtk-theme" "Blackbird GTK theme$(_inst blackbird-gtk-theme)" "$blackbird_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" \ "bluebird-gtk-theme" "Bluebird GTK theme$(_inst bluebird-gtk-theme)" "$bluebird_state" \
@@ -464,8 +485,12 @@ _cat_themes() {
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 $headless; then
echo "Skipping $pkg (headless mode)"
continue
fi
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -475,6 +500,8 @@ _cat_themes() {
} }
_cat_icons() { _cat_icons() {
local headless=false
_is_headless && headless=true
local breeze_state="OFF"; is_installed "breeze-icon-theme" && breeze_state="ON" local breeze_state="OFF"; is_installed "breeze-icon-theme" && breeze_state="ON"
local deepin_state="OFF"; is_installed "deepin-icon-theme" && deepin_state="ON" local deepin_state="OFF"; is_installed "deepin-icon-theme" && deepin_state="ON"
local ele_state="OFF"; is_installed "elementary-icon-theme" && ele_state="ON" local ele_state="OFF"; is_installed "elementary-icon-theme" && ele_state="ON"
@@ -494,8 +521,6 @@ _cat_icons() {
has_kf6=true has_kf6=true
fi fi
local height=18
local list_height=11
local items=( local items=(
"breeze-icon-theme" "Breeze icon theme$(_inst breeze-icon-theme)" "$breeze_state" "breeze-icon-theme" "Breeze icon theme$(_inst breeze-icon-theme)" "$breeze_state"
"deepin-icon-theme" "Deepin icon theme$(_inst deepin-icon-theme)" "$deepin_state" "deepin-icon-theme" "Deepin icon theme$(_inst deepin-icon-theme)" "$deepin_state"
@@ -511,13 +536,11 @@ _cat_icons() {
) )
if $has_kf6; then if $has_kf6; then
items+=("kf6-breeze-icon-theme" "KF6 Breeze icon theme$(_inst kf6-breeze-icon-theme)" "$kf6_state") items+=("kf6-breeze-icon-theme" "KF6 Breeze icon theme$(_inst kf6-breeze-icon-theme)" "$kf6_state")
height=20
list_height=12
fi fi
local choices local choices
choices=$(dialog --title "Icon Themes" --checklist \ choices=$(whiptail --title "Icon Themes" --checklist \
"Select icon themes to install:" "$height" 72 "$list_height" \ "Select icon themes to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"${items[@]}" \ "${items[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
clear clear
@@ -527,8 +550,12 @@ _cat_icons() {
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 $headless; then
echo "Skipping $pkg (headless mode)"
continue
fi
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -555,14 +582,11 @@ _cat_fetch() {
fi fi
local items=() local items=()
local height=14
local list_height=3
if [ "$fetch_pkg" = "fastfetch" ]; then if [ "$fetch_pkg" = "fastfetch" ]; then
items+=("fastfetch" "System info fetcher$(_inst fastfetch)" "$fetch_state") items+=("fastfetch" "System info fetcher$(_inst fastfetch)" "$fetch_state")
if [ "$DEBIAN_CODENAME" = "trixie" ]; then if [ "$DEBIAN_CODENAME" = "trixie" ]; then
items+=("hyfetch" "Neofetch with pride flags$(_inst hyfetch)" "$hyfetch_state") items+=("hyfetch" "Neofetch with pride flags$(_inst hyfetch)" "$hyfetch_state")
height=16; list_height=4
fi fi
fi fi
items+=("linuxlogo" "Linux logo + system info$(_inst linuxlogo)" "$linuxlogo_state") items+=("linuxlogo" "Linux logo + system info$(_inst linuxlogo)" "$linuxlogo_state")
@@ -570,14 +594,14 @@ _cat_fetch() {
items+=("neofetch" "System info fetcher$(_inst neofetch)" "$fetch_state") items+=("neofetch" "System info fetcher$(_inst neofetch)" "$fetch_state")
if [ "$DEBIAN_CODENAME" = "trixie" ]; then if [ "$DEBIAN_CODENAME" = "trixie" ]; then
items+=("hyfetch" "Neofetch with pride flags$(_inst hyfetch)" "$hyfetch_state") items+=("hyfetch" "Neofetch with pride flags$(_inst hyfetch)" "$hyfetch_state")
height=16; list_height=4
fi fi
fi fi
items+=("screenfetch" "System info (BSD/Linux)$(_inst screenfetch)" "$screenfetch_state") items+=("screenfetch" "System info (BSD/Linux)$(_inst screenfetch)" "$screenfetch_state")
local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6))
local choices local choices
choices=$(dialog --title "Fetch Tools" --checklist \ choices=$(whiptail --title "Fetch Tools" --checklist \
"Select system info tools:" "$height" 72 "$list_height" \ "Select system info tools:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \
"${items[@]}" \ "${items[@]}" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
clear clear
@@ -590,14 +614,14 @@ _cat_fetch() {
case $pkg in case $pkg in
neofetch|fastfetch) neofetch|fastfetch)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
;; ;;
*) *)
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -609,6 +633,8 @@ _cat_fetch() {
} }
_cat_download() { _cat_download() {
local headless=false
_is_headless && headless=true
local aria2_state="OFF"; is_installed "aria2" && aria2_state="ON" local aria2_state="OFF"; is_installed "aria2" && aria2_state="ON"
local filezilla_state="OFF"; is_installed "filezilla" && filezilla_state="ON" local filezilla_state="OFF"; is_installed "filezilla" && filezilla_state="ON"
local riseupvpn_state="OFF"; is_installed "riseup-vpn" && riseupvpn_state="ON" local riseupvpn_state="OFF"; is_installed "riseup-vpn" && riseupvpn_state="ON"
@@ -624,10 +650,11 @@ _cat_download() {
local tr_gtk_state="OFF"; is_installed "transmission-gtk" && tr_gtk_state="ON" local tr_gtk_state="OFF"; is_installed "transmission-gtk" && tr_gtk_state="ON"
local tr_qt_state="OFF"; is_installed "transmission-qt" && tr_qt_state="ON" local tr_qt_state="OFF"; is_installed "transmission-qt" && tr_qt_state="ON"
local TUI_ANCHO_REFORZADO=$((TUI_ANCHO + 6))
local choices1 choices2="" local choices1 choices2=""
choices1=$(dialog --title "Download & Network — Downloaders" --checklist \ choices1=$(whiptail --title "Download & Network — Downloaders" --checklist \
"Select download tools:" 16 72 5 \ "Select download tools:" $TUI_ALTO $TUI_ANCHO_REFORZADO $TUI_ALTO_LISTA \
"aria2" "Multiprotocol downloader (CLI)$(_inst aria2)" "$aria2_state" \ "aria2" "Multiprotocol downloader (CLI)$(_inst aria2)" "$aria2_state" \
"filezilla" "FTP/SFTP client (GUI)$(_inst filezilla)" "$filezilla_state" \ "filezilla" "FTP/SFTP client (GUI)$(_inst filezilla)" "$filezilla_state" \
"riseup-vpn" "Riseup VPN client$(_inst riseup-vpn)" "$riseupvpn_state" \ "riseup-vpn" "Riseup VPN client$(_inst riseup-vpn)" "$riseupvpn_state" \
@@ -636,8 +663,8 @@ _cat_download() {
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
clear clear
choices2=$(dialog --title "Download & Network — Torrent Clients" --checklist \ choices2=$(whiptail --title "Download & Network — Torrent Clients" --checklist \
"Select torrent clients:" 18 72 8 \ "Select torrent clients:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"deluge" "BitTorrent client (GTK)$(_inst deluge)" "$deluge_state" \ "deluge" "BitTorrent client (GTK)$(_inst deluge)" "$deluge_state" \
"deluged" "BitTorrent daemon/server$(_inst deluged)" "$deluged_state" \ "deluged" "BitTorrent daemon/server$(_inst deluged)" "$deluged_state" \
"mktorrent" "Torrent metainfo creator (CLI)$(_inst mktorrent)" "$mktorrent_state" \ "mktorrent" "Torrent metainfo creator (CLI)$(_inst mktorrent)" "$mktorrent_state" \
@@ -669,8 +696,12 @@ _cat_download() {
install_backports_or_stable qbittorrent-nox install_backports_or_stable qbittorrent-nox
;; ;;
*) *)
if $headless; then
echo "Skipping $pkg (headless mode)"
continue
fi
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -682,6 +713,8 @@ _cat_download() {
} }
_cat_design() { _cat_design() {
local headless=false
_is_headless && headless=true
local audacity_state="OFF"; is_installed "audacity" && audacity_state="ON" local audacity_state="OFF"; is_installed "audacity" && audacity_state="ON"
local ardour_state="OFF"; is_installed "ardour" && ardour_state="ON" local ardour_state="OFF"; is_installed "ardour" && ardour_state="ON"
local blender_state="OFF"; is_installed "blender" && blender_state="ON" local blender_state="OFF"; is_installed "blender" && blender_state="ON"
@@ -696,8 +729,8 @@ _cat_design() {
local shotcut_state="OFF"; is_installed "shotcut" && shotcut_state="ON" local shotcut_state="OFF"; is_installed "shotcut" && shotcut_state="ON"
local choices local choices
choices=$(dialog --title "Multimedia & Design" --checklist \ choices=$(whiptail --title "Multimedia & Design" --checklist \
"Select multimedia and design tools:" 20 72 12 \ "Select multimedia and design tools:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"audacity" "Audio editor/recorder$(_inst audacity)" "$audacity_state" \ "audacity" "Audio editor/recorder$(_inst audacity)" "$audacity_state" \
"ardour" "Digital audio workstation$(_inst ardour)" "$ardour_state" \ "ardour" "Digital audio workstation$(_inst ardour)" "$ardour_state" \
"blender" "3D modeling/animation suite$(_inst blender)" "$blender_state" \ "blender" "3D modeling/animation suite$(_inst blender)" "$blender_state" \
@@ -718,8 +751,12 @@ _cat_design() {
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 $headless; then
echo "Skipping $pkg (headless mode)"
continue
fi
if ! is_installed "$pkg"; then if ! is_installed "$pkg"; then
sudo apt install -y "$pkg" _run_install "$pkg"
else else
echo "$pkg already installed." echo "$pkg already installed."
fi fi
@@ -737,8 +774,7 @@ install_firefox_mozilla() {
echo "Setting up Mozilla APT repository for Firefox..." echo "Setting up Mozilla APT repository for Firefox..."
if is_installed "firefox-esr"; then if is_installed "firefox-esr"; then
if whiptail --title "Firefox ESR" --yesno \ if _confirm "Firefox ESR" "Firefox ESR is installed.\nRemove it before installing Mozilla Firefox?"; then
"Firefox ESR is installed.\n\nRemove it before installing Mozilla Firefox?\n\nChoose No to keep both Firefox versions." 11 60; then
echo "Removing Firefox ESR..." echo "Removing Firefox ESR..."
sudo apt remove -y firefox-esr sudo apt remove -y firefox-esr
else else
@@ -746,8 +782,8 @@ install_firefox_mozilla() {
fi fi
fi fi
! is_installed "wget" && sudo apt install -y wget ! is_installed "wget" && _run_install wget
! is_installed "gpg" && sudo apt install -y gpg ! is_installed "gpg" && _run_install gpg
sudo install -d -m 0755 /etc/apt/keyrings sudo install -d -m 0755 /etc/apt/keyrings
@@ -784,8 +820,8 @@ Pin: origin packages.mozilla.org
Pin-Priority: 1000 Pin-Priority: 1000
EOF EOF
sudo apt update _run_cmd "APT Update" "sudo apt update" "Updating package lists..."
sudo apt install -y firefox _run_install firefox
echo -e "${GREEN}Firefox (Mozilla) installed.${NC}" echo -e "${GREEN}Firefox (Mozilla) installed.${NC}"
} }
+6 -8
View File
@@ -14,8 +14,7 @@ install_firmware() {
fw_ver=$(apt-cache policy firmware-linux-nonfree 2>/dev/null | awk 'NR==3 {print $2; exit}') fw_ver=$(apt-cache policy firmware-linux-nonfree 2>/dev/null | awk 'NR==3 {print $2; exit}')
fw_pkgs=" - firmware-linux-nonfree ${fw_ver}\n" fw_pkgs=" - firmware-linux-nonfree ${fw_ver}\n"
fi fi
if ! whiptail --title "Base Firmware" --yesno \ if ! _confirm "Base Firmware" "Install firmware?\n\n${fw_pkgs}"; then
"Install the following package?\n\n${fw_pkgs}\nProvides firmware for various hardware components.\n\nProceed?" 14 65; then
echo "Skipping base firmware." echo "Skipping base firmware."
return return
fi fi
@@ -23,9 +22,9 @@ install_firmware() {
echo -e "${YELLOW}Installing base firmware...${NC}" echo -e "${YELLOW}Installing base firmware...${NC}"
local pkg="firmware-linux-nonfree" local pkg="firmware-linux-nonfree"
if [ "$(is_backports_enabled)" == true ] && [ -n "$fw_bpo" ]; then if [ "$(is_backports_enabled)" == true ] && [ -n "$fw_bpo" ]; then
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" $pkg _run_cmd "Firmware" "sudo apt install -y -t ${DEBIAN_CODENAME}-backports $pkg" "Installing firmware from backports..."
else else
sudo apt install -y $pkg _run_cmd "Firmware" "sudo apt install -y $pkg" "Installing firmware..."
fi fi
echo -e "${GREEN}Base firmware installed.${NC}" echo -e "${GREEN}Base firmware installed.${NC}"
@@ -57,12 +56,11 @@ handle_wifi_firmware() {
if echo "$supported_ids" | grep -qw "$device_id"; then if echo "$supported_ids" | grep -qw "$device_id"; then
echo "Chipset supported by firmware-brcm80211. Installing..." echo "Chipset supported by firmware-brcm80211. Installing..."
sudo apt install -y firmware-brcm80211 _run_cmd "WiFi" "sudo apt install -y firmware-brcm80211" "Installing Broadcom firmware..."
else else
# Offer to install broadcom-sta-dkms for older chips # Offer to install broadcom-sta-dkms for older chips
if whiptail --title "Broadcom WiFi" \ if _confirm "Broadcom WiFi" "Install broadcom-sta-dkms?\n\nRequired for this Broadcom chipset.\nCompiles a kernel module (needs linux-headers)."; then
--yesno "Your Broadcom chipset may require the proprietary driver (broadcom-sta-dkms).\nThis will also install linux-headers and compile a kernel module.\n\nInstall broadcom-sta-dkms?" 12 70; then _run_cmd "Broadcom" "sudo apt install -y linux-headers-$(uname -r) broadcom-sta-dkms" "Installing Broadcom driver..."
sudo apt install -y linux-headers-$(uname -r) broadcom-sta-dkms
echo "Broadcom proprietary driver installed. A reboot may be required." echo "Broadcom proprietary driver installed. A reboot may be required."
else else
echo "Skipping Broadcom driver installation." echo "Skipping Broadcom driver installation."
+21 -23
View File
@@ -6,8 +6,7 @@ install_gaming() {
# 1. 32-bit support prompt FIRST # 1. 32-bit support prompt FIRST
local enable_32bit=false local enable_32bit=false
if whiptail --title "32-bit Support" --yesno \ if _confirm "32-bit Support" "Enable i386 for 32-bit games?\n\nRequired by Steam/Proton.\nInstalls matching 32-bit graphics drivers."; then
"Enable 32-bit architecture for gaming?\n\nThis enables i386 support and installs 32-bit\ngraphics drivers needed by Steam and Proton\nfor running 32-bit games with GPU acceleration.\n\nRequired for: Steam\nRecommended for: old games via Wine/Proton\n\nProceed?" 15 65; then
enable_32bit=true enable_32bit=true
fi fi
@@ -16,26 +15,26 @@ install_gaming() {
if ! dpkg --print-foreign-architectures | grep -q i386; then if ! dpkg --print-foreign-architectures | grep -q i386; then
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
fi fi
sudo apt update _run_cmd "APT Update" "sudo apt update" "Updating package lists..."
echo "Installing 32-bit graphics drivers..." echo "Installing 32-bit graphics drivers..."
if [ "$GPU_TYPE" = "nvidia" ]; then if [ "$GPU_TYPE" = "nvidia" ]; then
sudo apt install -y nvidia-driver-libs:i386 _run_cmd "32-bit" "sudo apt install -y nvidia-driver-libs:i386" "Installing 32-bit NVIDIA drivers..."
else else
sudo apt install -y mesa-vulkan-drivers libglx-mesa0:i386 mesa-vulkan-drivers:i386 libgl1-mesa-dri:i386 _run_cmd "32-bit" "sudo apt install -y mesa-vulkan-drivers libglx-mesa0:i386 mesa-vulkan-drivers:i386 libgl1-mesa-dri:i386" "Installing 32-bit Mesa drivers..."
fi fi
fi fi
# 2. Gaming packages checklist # 2. Gaming packages checklist
local choices local choices
choices=$(whiptail --title "Gaming Setup" --checklist \ choices=$(whiptail --title "Gaming Setup" --checklist \
"Select gaming packages to install:" 16 72 6 \ "Select gaming packages to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"steam" "Steam (official .deb from Valve, requires 32-bit)" ON \ "steam" "Steam (official .deb, needs 32-bit)" ON \
"gamemode" "Optimise system for gaming" ON \ "gamemode" "Game performance optimization" ON \
"mangohud" "Vulkan/OpenGL performance overlay" ON \ "mangohud" "Performance overlay (Vulkan/GL)" ON \
"heroic" "Heroic Games Launcher (Epic Games, GOG) - .deb" OFF \ "heroic" "Heroic Launcher (Epic/GOG) .deb" OFF \
"goverlay" "GUI for configuring MangoHud" ON \ "goverlay" "MangoHud config GUI" ON \
"lutris" "Game launcher/runner" OFF \ "lutris" "Game launcher/manager" OFF \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ -z "$choices" ]; then if [ -z "$choices" ]; then
@@ -56,37 +55,36 @@ install_gaming() {
for pkg in $cleaned; do for pkg in $cleaned; do
case $pkg in case $pkg in
steam) steam)
echo "Downloading official Steam .deb..."
local steam_deb="/tmp/steam_latest.deb" local steam_deb="/tmp/steam_latest.deb"
wget -O "$steam_deb" "https://cdn.fastly.steamstatic.com/client/installer/steam.deb" _run_cmd "Steam" "wget -O $steam_deb https://cdn.fastly.steamstatic.com/client/installer/steam.deb" "Downloading Steam..."
sudo apt install -y "$steam_deb" _run_cmd "Steam" "sudo apt install -y $steam_deb" "Installing Steam..."
echo -e "${GREEN}Steam installed.${NC}"
;; ;;
mangohud) mangohud)
sudo apt install -y mangohud _run_cmd "MangoHud" "sudo apt install -y mangohud" "Installing MangoHud..."
if $enable_32bit; then if $enable_32bit; then
echo "Installing 32-bit MangoHud..." echo "Installing 32-bit MangoHud..."
sudo apt install -y mangohud:i386 _run_cmd "MangoHud" "sudo apt install -y mangohud:i386" "Installing 32-bit MangoHud..."
fi fi
;; ;;
heroic) heroic)
echo "Downloading Heroic Games Launcher..."
sudo apt install -y curl wget 2>/dev/null || true
local heroic_deb="/tmp/heroic.deb" local heroic_deb="/tmp/heroic.deb"
_run_cmd "Heroic" "sudo apt install -y curl wget" "Installing dependencies..."
local gh_url local gh_url
gh_url=$(curl -s https://api.github.com/repos/Heroic-Games-Launcher/\ gh_url=$(curl -s --connect-timeout 10 https://api.github.com/repos/Heroic-Games-Launcher/\
HeroicGamesLauncher/releases/latest | \ HeroicGamesLauncher/releases/latest | \
grep -oP 'https://[^"]+amd64\.deb' | head -1) grep -oP 'https://[^"]+amd64\.deb' | head -1)
if [ -z "$gh_url" ]; then if [ -z "$gh_url" ]; then
echo -e "${RED}Could not determine latest Heroic release.${NC}" echo -e "${RED}Could not determine latest Heroic release.${NC}"
else else
wget -O "$heroic_deb" "$gh_url" _run_cmd "Heroic" "wget -O $heroic_deb $gh_url" "Downloading Heroic..."
sudo apt install -y "$heroic_deb" _run_cmd "Heroic" "sudo apt install -y $heroic_deb" "Installing Heroic..."
rm -f "$heroic_deb" rm -f "$heroic_deb"
echo -e "${GREEN}Heroic Games Launcher installed.${NC}" echo -e "${GREEN}Heroic Games Launcher installed.${NC}"
fi fi
;; ;;
*) *)
sudo apt install -y "$pkg" _run_install "$pkg"
;; ;;
esac esac
done done
+17 -32
View File
@@ -7,8 +7,7 @@ install_gpu_drivers() {
intel) install_intel ;; intel) install_intel ;;
nvidia) install_nvidia ;; nvidia) install_nvidia ;;
*) *)
echo -e "${YELLOW}No supported GPU detected or unknown GPU type.${NC}" _msg "GPU" "No dedicated GPU detected.\n\nIf you are in a virtual machine, GPU acceleration\ndepends on VM configuration (SPICE, VirtIO).\n\nNo additional drivers will be installed." 12 60
echo "You can install GPU drivers manually later."
return return
;; ;;
esac esac
@@ -25,19 +24,17 @@ install_gpu_drivers() {
mesa_pkgs+=" - ${mpkg} (from stable)\n" mesa_pkgs+=" - ${mpkg} (from stable)\n"
fi fi
done done
if whiptail --title "Mesa Backports" --yesno \ if _confirm_custom "Mesa Backports" "Install Mesa?\n${mesa_pkgs}" "Backports" "Stable"; then
"Install newer Mesa GPU drivers from backports?\n\n${mesa_pkgs}\nRecommended for better GPU performance and gaming." 14 65; then _run_cmd "Mesa" "sudo apt install -y -t ${DEBIAN_CODENAME}-backports libgl1-mesa-dri mesa-vulkan-drivers" "Installing Mesa from backports..."
echo "Installing Mesa from backports..." else
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" libgl1-mesa-dri mesa-vulkan-drivers _run_cmd "Mesa" "sudo apt install -y libgl1-mesa-dri mesa-vulkan-drivers" "Installing Mesa from stable..."
fi fi
fi fi
local tool_pkgs local tool_pkgs
tool_pkgs=$(pkg_versions nvtop vainfo) tool_pkgs=$(pkg_versions nvtop vainfo)
if whiptail --title "GPU Tools" --yesno \ if _confirm "GPU Tools" "Install monitoring tools?\n${tool_pkgs}"; then
"Install the following packages?\n\n${tool_pkgs}\nProceed?" 14 65; then _run_cmd "GPU Tools" "sudo apt install -y nvtop vainfo" "Installing GPU tools..."
sudo apt install -y nvtop vainfo
echo ""
vainfo vainfo
else else
echo "Skipping GPU monitoring tools." echo "Skipping GPU monitoring tools."
@@ -51,13 +48,11 @@ install_gpu_drivers() {
install_amd() { install_amd() {
local pkgs local pkgs
pkgs=$(pkg_versions firmware-amd-graphics radeontop) pkgs=$(pkg_versions firmware-amd-graphics radeontop)
if ! whiptail --title "AMD GPU" --yesno \ if ! _confirm "AMD GPU" "Install AMD drivers?\n${pkgs}"; then
"Install the following packages?\n\n${pkgs}\nProceed?" 14 65; then
echo "Skipping AMD GPU drivers." echo "Skipping AMD GPU drivers."
return return
fi fi
echo -e "${YELLOW}Installing AMD GPU drivers and firmware...${NC}" _run_cmd "AMD" "sudo apt install -y firmware-amd-graphics radeontop" "Installing AMD drivers..."
sudo apt install -y firmware-amd-graphics radeontop
echo -e "${GREEN}AMD drivers installed.${NC}" echo -e "${GREEN}AMD drivers installed.${NC}"
} }
@@ -76,19 +71,16 @@ install_intel() {
local pkgs local pkgs
pkgs=$(pkg_versions firmware-intel-graphics "$va_driver") pkgs=$(pkg_versions firmware-intel-graphics "$va_driver")
if ! whiptail --title "Intel GPU" --yesno \ if ! _confirm "Intel GPU" "Install Intel drivers?\n${pkgs}"; then
"Install the following packages?\n\n${pkgs}\nProceed?" 14 65; then
echo "Skipping Intel GPU drivers." echo "Skipping Intel GPU drivers."
return return
fi fi
echo -e "${YELLOW}Installing Intel GPU firmware and drivers...${NC}" _run_cmd "Intel" "sudo apt install -y firmware-intel-graphics" "Installing Intel firmware..."
sudo apt install -y firmware-intel-graphics
echo "Detected Intel GPU generation: $gen" echo "Detected Intel GPU generation: $gen"
echo "Installing ${va_driver}..." echo "Installing ${va_driver}..."
sudo apt install -y "$va_driver" _run_cmd "Intel" "sudo apt install -y $va_driver" "Installing Intel VA driver..."
echo -e "${GREEN}Intel GPU drivers installed.${NC}" echo -e "${GREEN}Intel GPU drivers installed.${NC}"
} }
@@ -113,16 +105,13 @@ install_nvidia() {
echo "NVIDIA driver. The script will now install the recommended driver" echo "NVIDIA driver. The script will now install the recommended driver"
echo "from the STABLE repositories only, NOT from backports." echo "from the STABLE repositories only, NOT from backports."
if ! whiptail --title "NVIDIA + Backports Warning" \ if ! _confirm "NVIDIA + Backports" "Backports kernel (6.19+) may break NVIDIA driver.\nContinue with stable NVIDIA driver?"; then
--yesno "You have backports enabled.\n\nThere is a known conflict between backports kernels (6.19+) and the NVIDIA driver.\n\nDo you want to continue using the stable NVIDIA driver?\n\n(Choose No to skip NVIDIA installation)" 15 70; then
echo "Skipping NVIDIA driver installation." echo "Skipping NVIDIA driver installation."
return 0 return 0
fi fi
fi fi
# Install nvidia-detect _run_cmd "NVIDIA" "sudo apt install -y nvidia-detect" "Installing nvidia-detect..."
echo "Installing nvidia-detect..."
sudo apt install -y nvidia-detect
# Run nvidia-detect and parse the recommended package # Run nvidia-detect and parse the recommended package
echo "Detecting recommended NVIDIA driver..." echo "Detecting recommended NVIDIA driver..."
@@ -165,15 +154,11 @@ install_nvidia() {
local nv_pkgs local nv_pkgs
nv_pkgs=$(pkg_versions "$recommended" firmware-misc-nonfree nvidia-vaapi-driver) nv_pkgs=$(pkg_versions "$recommended" firmware-misc-nonfree nvidia-vaapi-driver)
if ! whiptail --title "NVIDIA Driver" --yesno \ if ! _confirm "NVIDIA Driver" "Install NVIDIA driver?\n${nv_pkgs}\nReboot required."; then
"Install the following packages?\n\n${nv_pkgs}\nA reboot will be required.\n\nProceed?" 14 65; then
echo "Skipping NVIDIA driver installation." echo "Skipping NVIDIA driver installation."
return 0 return 0
fi fi
sudo apt install -y "$recommended" firmware-misc-nonfree nvidia-vaapi-driver _run_cmd "NVIDIA" "sudo apt install -y $recommended firmware-misc-nonfree nvidia-vaapi-driver" "Installing NVIDIA driver..."
echo -e "${GREEN}NVIDIA drivers installed. Reboot required.${NC}"
echo -e "${GREEN}NVIDIA drivers installed.${NC}"
echo "A reboot is required to load the NVIDIA kernel module."
echo "After reboot, run 'nvidia-smi' to verify the installation."
} }
+8 -41
View File
@@ -2,62 +2,29 @@
# kernel.sh # kernel.sh
install_kernel_backports() { install_kernel_backports() {
echo -e "${YELLOW}Kernel from Backports${NC}"
# Check if backports are enabled at system level
if [ "$(is_backports_enabled)" != "true" ]; then if [ "$(is_backports_enabled)" != "true" ]; then
echo -e "${YELLOW}Backports repository is not enabled.${NC}" _msg "Kernel" "Backports repository is not enabled.\n\nUse option 3 (Configure repositories) to enable backports\nbefore installing the backports kernel."
echo "Use option 2 (Configure repositories) to enable backports first."
return 1 return 1
fi fi
local backports_kernel_ver local backports_kernel_ver
backports_kernel_ver=$(get_backports_kernel_version) backports_kernel_ver=$(get_backports_kernel_version)
echo "This will install the latest stable kernel from backports." local msg="Install the latest kernel from backports?"
echo " - Newer hardware support"
echo " - Potential performance improvements"
if [ "$backports_kernel_ver" != "unknown" ]; then if [ "$backports_kernel_ver" != "unknown" ]; then
echo " - Kernel version available: $backports_kernel_ver" msg+="\n\nVersion: $backports_kernel_ver"
else
echo " - Kernel version could not be determined at this time"
fi fi
echo "" msg+="\nOlder kernels remain available in GRUB."
# Extra warning if NVIDIA GPU is detected
if [ "$GPU_TYPE" == "nvidia" ]; then
echo -e "${RED}============================================${NC}"
echo -e "${RED} WARNING: NVIDIA GPU detected${NC}"
echo -e "${RED}============================================${NC}"
echo "Backports kernels (6.19+) can break the NVIDIA 550 driver."
echo "If you installed the NVIDIA driver earlier, this may cause"
echo "display issues or DKMS compilation failures."
echo ""
fi
# Build the whiptail message dynamically
local msg
msg="Do you want to install the latest kernel from backports?\n\n"
if [ "$backports_kernel_ver" != "unknown" ]; then
msg+="Kernel version: $backports_kernel_ver\n\n"
fi
msg+="This replaces the current linux-image-amd64 metapackage.\n"
msg+="You can still boot older kernels from GRUB.\n"
if [ "$GPU_TYPE" == "nvidia" ]; then if [ "$GPU_TYPE" == "nvidia" ]; then
msg+="\n WARNING: NVIDIA GPU detected.\n" msg+="\n\nWARNING: may break NVIDIA driver."
msg+="Backports kernels (6.19+) may break the NVIDIA 550 driver.\n"
fi fi
if ! whiptail --title "Install Kernel from Backports" \ if ! _confirm "Backports Kernel" "$msg"; then
--yesno "$msg" 16 70; then
echo "Skipping kernel installation." echo "Skipping kernel installation."
return return
fi fi
echo "Installing kernel from backports..." _run_cmd "Kernel" "sudo apt install -y -t ${DEBIAN_CODENAME}-backports linux-image-amd64" "Installing kernel from backports..."
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" linux-image-amd64 echo -e "${GREEN}Kernel installed. Reboot to use it.${NC}"
echo -e "${GREEN}Kernel from backports installed.${NC}"
echo "Please reboot to use the new kernel."
} }
+8 -11
View File
@@ -52,18 +52,14 @@ configure_repos() {
local use_deb822=false local use_deb822=false
if [ "$DEBIAN_CODENAME" = "trixie" ]; then if [ "$DEBIAN_CODENAME" = "trixie" ]; then
if whiptail --title "Repository Format" --defaultno \ if whiptail --title "Repository Format" --defaultno --yesno "Use deb822 format (modern .sources)?" 8 60; then
--yesno "Use the modern .sources (deb822) format?\n(default is classic one-line style)" 10 60; then
use_deb822=true use_deb822=true
fi fi
fi fi
local enable_backports local enable_backports=false
if whiptail --title "Backports" \ if _confirm "Backports" "Enable backports repository?\n\nProvides newer kernel, drivers, Mesa."; then
--yesno "Enable backports?\nBackports provide newer versions of some software (kernel, drivers, Mesa) for better hardware support.\nIt is recommended to enable it (default: Yes)." 12 70; then
enable_backports=true enable_backports=true
else
enable_backports=false
fi fi
if [ -z "$DEBIAN_CODENAME" ]; then if [ -z "$DEBIAN_CODENAME" ]; then
@@ -82,7 +78,9 @@ configure_repos() {
fi fi
echo "Updating package lists..." echo "Updating package lists..."
if sudo apt update; then sudo apt update
local apt_rc=$?
if [ $apt_rc -eq 0 ]; then
REPOS_CONFIGURED=true REPOS_CONFIGURED=true
echo -e "${GREEN}Repositories configured and updated successfully.${NC}" echo -e "${GREEN}Repositories configured and updated successfully.${NC}"
@@ -95,10 +93,9 @@ configure_repos() {
local upgradable local upgradable
upgradable=$(apt list --upgradable 2>/dev/null | grep -c /) upgradable=$(apt list --upgradable 2>/dev/null | grep -c /)
if [ "$upgradable" -gt 0 ]; then if [ "$upgradable" -gt 0 ]; then
if whiptail --title "Upgrade System" \ if _confirm "Upgrade System" "$upgradable packages can be upgraded. Upgrade now?"; then
--yesno "There are $upgradable packages that can be upgraded.\n\nDo you want to upgrade them now?" 10 60; then
sudo apt-mark hold tzdata 2>/dev/null || true sudo apt-mark hold tzdata 2>/dev/null || true
sudo apt upgrade -y _run_cmd "Upgrade" "sudo apt upgrade -y" "Upgrading system..."
sudo apt-mark unhold tzdata 2>/dev/null || true sudo apt-mark unhold tzdata 2>/dev/null || true
sudo apt autoremove -y sudo apt autoremove -y
sudo apt autoclean sudo apt autoclean
+1 -5
View File
@@ -17,11 +17,7 @@ config_sudo() {
fi fi
fi fi
local answer if _confirm "Sudo Password Feedback" "Show asterisks when typing the sudo password?"; then
answer=$(whiptail --title "Sudo Password Feedback" \
--yesno "Show asterisks when typing the sudo password?" 8 60 3>&1 1>&2 2>&3)
local exitstatus=$?
if [ $exitstatus -eq 0 ]; then
echo 'Defaults pwfeedback' | sudo tee /etc/sudoers.d/pwfeedback > /dev/null echo 'Defaults pwfeedback' | sudo tee /etc/sudoers.d/pwfeedback > /dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo -e "${GREEN}Password feedback enabled.${NC}" echo -e "${GREEN}Password feedback enabled.${NC}"
+90 -7
View File
@@ -260,9 +260,11 @@ install_backports_or_stable() {
if [ -n "$bpo_ver" ]; then if [ -n "$bpo_ver" ]; then
local current_ver local current_ver
current_ver=$(dpkg -l "$pkg" 2>/dev/null | awk '/^ii/{print $3}') current_ver=$(dpkg -l "$pkg" 2>/dev/null | awk '/^ii/{print $3}')
if whiptail --title "Backports: ${pkg}" --yesno \ if _confirm "Backports: ${pkg}" \
"${pkg} is installed (${current_ver}).\n\nUpgrade to backports version ${bpo_ver}?" 12 62; then "${pkg} ${current_ver} installed.\nUpgrade to backports ${bpo_ver}?"; then
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" "$pkg" _run_cmd "Backports" \
"sudo DEBIAN_FRONTEND=noninteractive apt install -y -t ${DEBIAN_CODENAME}-backports $pkg" \
"Upgrading $pkg..."
return return
fi fi
fi fi
@@ -273,13 +275,94 @@ install_backports_or_stable() {
if [ -n "$bpo_ver" ]; then if [ -n "$bpo_ver" ]; then
local stable_ver local stable_ver
stable_ver=$(apt-cache policy "$pkg" 2>/dev/null | awk 'NR==3 {print $2; exit}') stable_ver=$(apt-cache policy "$pkg" 2>/dev/null | awk 'NR==3 {print $2; exit}')
if whiptail --title "Backports: ${pkg}" --yesno \ if _confirm_custom "${pkg}" "Install from backports?\n\nBackports: ${bpo_ver}\nStable: ${stable_ver:-N/A}" "Backports" "Stable"; then
"Install ${pkg} from backports?\n\nBackports: ${bpo_ver}\nStable: ${stable_ver:-N/A}\n\nChoose Yes for backports, No for stable." 12 62; then _run_cmd "Backports" \
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" "$pkg" "sudo DEBIAN_FRONTEND=noninteractive apt install -y -t ${DEBIAN_CODENAME}-backports $pkg" \
"Installing $pkg from backports..."
return return
fi fi
# User chose "Stable" — install stable directly, no re-prompt
_run_cmd "APT" "sudo DEBIAN_FRONTEND=noninteractive apt install -y $pkg" "Installing $pkg from stable..."
return
fi
local stable_ver
stable_ver=$(apt-cache policy "$pkg" 2>/dev/null | awk 'NR==3 {print $2; exit}')
if _confirm "Install: ${pkg}" "Install ${pkg} ${stable_ver:-} from stable?"; then
_run_cmd "APT" "sudo DEBIAN_FRONTEND=noninteractive apt install -y $pkg" "Installing $pkg..."
fi
}
# ----------------------------------------------------------------------
# Whiptail helpers (4-block pattern)
# ----------------------------------------------------------------------
_confirm() {
whiptail --title "$1" --yes-button "Execute" --no-button "Skip" \
--yesno "$2" "${3:-10}" "${4:-65}"
}
_confirm_custom() {
local title="$1" text="$2" yes_btn="$3" no_btn="$4"
shift 4
whiptail --title "$title" --yes-button "$yes_btn" --no-button "$no_btn" \
--yesno "$text" "${@:-10 65}"
}
_msg() {
whiptail --title "$1" --msgbox "$2" "${3:-10}" "${4:-65}"
}
# Blocks 2-4: clear → run → pause
_run_cmd() {
local title="$1" command="$2" success_msg="${3:-Running...}"
clear
echo -e "${GREEN}[+]${NC} $success_msg"
echo "──────────────────────────────────────────────"
eval "$command"
local rc=$?
echo "──────────────────────────────────────────────"
if [ $rc -eq 0 ]; then
echo -e "${GREEN}[+]${NC} Done."
else
echo -e "${RED}[-]${NC} Failed (exit code: $rc)."
fi
echo "Press [ENTER] to continue..."
read -r
}
# Blocks 1-4: confirm → clear → run → pause
_run() {
if _confirm "$1" "$2"; then
_run_cmd "$1" "$3" "$4"
fi
}
_is_headless() {
[ -z "${DISPLAY:-}" ] && [ -z "${WAYLAND_DISPLAY:-}" ]
}
_run_install() {
local pkg="$1"
local ver
ver=$(apt-cache policy "$pkg" 2>/dev/null | awk 'NR==3 {print $2; exit}')
[ -z "$ver" ] && ver="(version unknown)"
if _confirm "Install: ${pkg}" "Install ${pkg}\nVersion: ${ver}?"; then
_run_cmd "Install" "sudo DEBIAN_FRONTEND=noninteractive apt install -y $pkg" "Installing $pkg..."
fi
}
_run_install_batch() {
local pkgs=("$@")
[ ${#pkgs[@]} -eq 0 ] && return 0
local ver_list=""
for pkg in "${pkgs[@]}"; do
local ver
ver=$(apt-cache policy "$pkg" 2>/dev/null | awk 'NR==3 {print $2; exit}')
ver_list+=" - ${pkg} ${ver:-unknown}\n"
done
if _confirm "Install" "Install these packages?\n${ver_list}"; then
_run_cmd "Install" "sudo DEBIAN_FRONTEND=noninteractive apt install -y ${pkgs[*]}" "Installing..."
fi fi
sudo apt install -y "$pkg"
} }
get_backports_kernel_version() { get_backports_kernel_version() {
+13 -10
View File
@@ -13,10 +13,16 @@ install_zram() {
local algo local algo
algo=$(whiptail --title "ZRAM Compression" --menu \ algo=$(whiptail --title "ZRAM Compression" --menu \
"ZRAM compresses a portion of RAM to use as\nswap, effectively increasing available memory.\n\nChoose the compression algorithm:\n\nlz4: Very fast, low CPU usage. Minimal latency.\n Recommended for most users.\n\nzstd: Better compression ratio (10-20% more),\n slightly higher CPU usage.\n\nPress Cancel to abort." \ "ZRAM compresses a portion of RAM into compressed swap,\
18 65 2 \ effectively increasing available memory.
"lz4" "Fastest, lowest CPU usage (recommended)" \
"zstd" "Best ratio, slightly more CPU" \ Useful for systems with limited RAM or when you need
more swap space without disk writes.
Choose compression algorithm:" \
$TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"lz4" "Fastest, low CPU (recommended)" \
"zstd" "Better ratio, more CPU" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
if [ -z "$algo" ]; then if [ -z "$algo" ]; then
@@ -25,8 +31,7 @@ install_zram() {
fi fi
local zram_size local zram_size
if whiptail --title "ZRAM Size" --yesno \ if _confirm "ZRAM Size" "Use 50% of RAM for ZRAM? (${half_ram_mb} MB out of ${RAM_SUMMARY})"; then
"Use 50% of RAM for ZRAM? (${half_ram_mb} MB out of ${RAM_SUMMARY})\n\nChoose No to enter a custom size." 10 60; then
zram_size=$half_ram_mb zram_size=$half_ram_mb
else else
zram_size=$(whiptail --title "ZRAM Size" --inputbox \ zram_size=$(whiptail --title "ZRAM Size" --inputbox \
@@ -37,14 +42,12 @@ install_zram() {
fi fi
fi fi
if ! whiptail --title "ZRAM Summary" --yesno \ if ! _confirm "ZRAM Summary" "Algorithm: ${algo}\nSize: ${zram_size} MB\nPriority: 100\n\nApply?"; then
"Algorithm: ${algo}\nSize: ${zram_size} MB (${RAM_SUMMARY} total)\nPriority: 100\n\nApply ZRAM configuration?" 13 60; then
echo "ZRAM configuration cancelled." echo "ZRAM configuration cancelled."
return 0 return 0
fi fi
echo -e "${YELLOW}Installing zram-tools...${NC}" _run_cmd "ZRAM" "sudo apt install -y zram-tools" "Installing zram-tools..."
sudo apt install -y zram-tools
echo "Writing configuration..." echo "Writing configuration..."
sudo tee /etc/default/zramswap > /dev/null <<EOF sudo tee /etc/default/zramswap > /dev/null <<EOF