mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-09-13 21:52:36 +00:00
dual-gpu fix & lspci cache
- Replaced the restrictive Broadcom firmware installation flow with a persistent, step-by-step process in modules/firmware.sh. Now installs dkms, wireless-tools, and linux-headers-amd64 separately, then applies blacklist configuration, updates initramfs, and loads conflicting modules properly. - Fixed conky package name across system.sh and bullseye/extras.sh. Changed from "conky" to "conky-all" with corresponding state variable updates for correct installation via apt. - Corrected broken GRUB sed command in modules/gpu.sh for AMD GCN support. Added grep guard to prevent duplicate parameter insertion and fixed regex pattern for proper cmdline modification. - Added whiptail pre-flight check in debianito.sh. Auto-installs required TUI dependencies if missing before the main menu, preventing runtime failures. - Fixed home directory path resolution bug in modules/sudo_config.sh. Replaced eval echo "~$USER" with getent passwd approach for reliable user home detection across SUDO_USER contexts. - Implemented global lspci output caching across 18+ locations. Single cache population via _init_lspci_cache() before detect_gpu, all subsequent reads use LSPCI_OUTPUT variable to eliminate redundant hardware polling calls. - Added apt update deduplication helper in modules/utils.sh. _ensure_apt_updated() with APT_UPDATED flag bypasses redundant package list refreshes across extras/, gaming/, firmware/, and desktop_display/ modules while preserving transactional rollback paths in repos.sh. - Fixed STATE_REFRESHED logic in debianito.sh main_menu case statement. Added STATE_REFRESHED=true to branches 3, 5, 7, 9, 11, 12, and 13 that mutate system state, ensuring refresh_system_state() triggers correctly after configuration changes. - Removed dead REPOS_CONFIGURED variable from debianito.sh and modules/repos.sh. Variable was written but never read, eliminated to clean up global namespace without affecting repository functionality.
This commit is contained in:
+37
-10
@@ -42,15 +42,14 @@ if [ -d "${MODULES_DIR}/bullseye" ]; then
|
||||
[ -f "${MODULES_DIR}/bullseye/extras.sh" ] && source "${MODULES_DIR}/bullseye/extras.sh"
|
||||
fi
|
||||
|
||||
REPOS_CONFIGURED=false
|
||||
DEBIAN_VERSION=""
|
||||
DEBIAN_CODENAME=""
|
||||
|
||||
main_menu() {
|
||||
# Auto-adjust TUI dimensions for small terminals
|
||||
if [ "${LINES:-24}" -lt $((TUI_ALTO + 6)) ] || [ "${COLUMNS:-80}" -lt $((TUI_ANCHO + 6)) ]; then
|
||||
TUI_ALTO=$(( ${LINES:-24} - 4 > 8 ? ${LINES:-24} - 4 : 8))
|
||||
TUI_ANCHO=$(( ${COLUMNS:-80} - 4 > 50 ? ${COLUMNS:-80} - 4 : 50))
|
||||
TUI_ALTO=$((${LINES:-24} - 4 > 8 ? ${LINES:-24} - 4 : 8))
|
||||
TUI_ANCHO=$((${COLUMNS:-80} - 4 > 50 ? ${COLUMNS:-80} - 4 : 50))
|
||||
TUI_ALTO_LISTA=$((TUI_ALTO - 10 > 4 ? TUI_ALTO - 10 : 4))
|
||||
fi
|
||||
|
||||
@@ -80,7 +79,10 @@ main_menu() {
|
||||
case "$choice" in
|
||||
1) _show_sysinfo ;;
|
||||
2) config_sudo || true ;;
|
||||
3) _system_preferences_menu ;;
|
||||
3)
|
||||
_system_preferences_menu
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
4)
|
||||
if [ "$DEBIAN_VERSION" = "11" ] && type configure_repos_bullseye &>/dev/null; then
|
||||
configure_repos_bullseye || true
|
||||
@@ -95,6 +97,7 @@ main_menu() {
|
||||
else
|
||||
install_firmware || true
|
||||
fi
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
6)
|
||||
local gpu_sub
|
||||
@@ -109,7 +112,10 @@ main_menu() {
|
||||
esac
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
7) show_kernel_menu || true ;;
|
||||
7)
|
||||
show_kernel_menu || true
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
8)
|
||||
if [ "$DEBIAN_VERSION" = "11" ] && type install_gaming_bullseye &>/dev/null; then
|
||||
install_gaming_bullseye || true
|
||||
@@ -118,18 +124,34 @@ main_menu() {
|
||||
fi
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
9) zram_menu || true ;;
|
||||
10) manage_swap || true; STATE_REFRESHED=true ;;
|
||||
9)
|
||||
zram_menu || true
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
10)
|
||||
manage_swap || true
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
11)
|
||||
if [ "$DEBIAN_VERSION" = "11" ] && type install_extras_bullseye &>/dev/null; then
|
||||
install_extras_bullseye || true
|
||||
else
|
||||
install_extras || true
|
||||
fi
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
12)
|
||||
rescue_boot || true
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
13)
|
||||
manage_desktop_display || true
|
||||
STATE_REFRESHED=true
|
||||
;;
|
||||
14)
|
||||
echo "Exiting."
|
||||
exit 0
|
||||
;;
|
||||
12) rescue_boot || true ;;
|
||||
13) manage_desktop_display || true ;;
|
||||
14) echo "Exiting."; exit 0 ;;
|
||||
esac
|
||||
if $STATE_REFRESHED; then
|
||||
refresh_system_state
|
||||
@@ -139,6 +161,10 @@ main_menu() {
|
||||
|
||||
check_root
|
||||
check_sudo
|
||||
if ! command -v whiptail >/dev/null 2>&1; then
|
||||
echo -e "${YELLOW}[+] whiptail not found. Installing required TUI dependencies...${NC}"
|
||||
_ensure_apt_updated && sudo apt-get install -y whiptail
|
||||
fi
|
||||
if ! _check_network; then
|
||||
echo -e "${YELLOW}──────────────────────────────────────────${NC}"
|
||||
echo -e "${YELLOW} No internet connectivity detected.${NC}"
|
||||
@@ -152,6 +178,7 @@ _ensure_time_synced
|
||||
detect_debian_version
|
||||
detect_cpu_ram
|
||||
detect_kernel
|
||||
_init_lspci_cache
|
||||
detect_gpu
|
||||
detect_network
|
||||
detect_displayserver
|
||||
|
||||
+76
-46
@@ -61,12 +61,13 @@ Instalar?"; then
|
||||
|
||||
_cat_customization_bullseye() {
|
||||
local sub
|
||||
sub=$(_menu "Customization (Bullseye)" "Select type:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
|
||||
sub=$(
|
||||
_menu "Customization (Bullseye)" "Select type:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
|
||||
"1" "Desktop Themes (GTK/KDE)" \
|
||||
"2" "Icon Themes" \
|
||||
"3" "Cursor Themes" \
|
||||
"4" "Fonts" \
|
||||
"5" "Terminals" \
|
||||
"5" "Terminals"
|
||||
)
|
||||
[ -z "$sub" ] && return
|
||||
case $sub in
|
||||
@@ -82,17 +83,19 @@ _cat_themes_bullseye() {
|
||||
local item_count=6
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Desktop Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Desktop Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"arc-theme" "Arc GTK theme" "$(_state arc-theme)" \
|
||||
"blackbird-gtk-theme" "Blackbird GTK theme" "$(_state blackbird-gtk-theme)" \
|
||||
"bluebird-gtk-theme" "Bluebird GTK theme" "$(_state bluebird-gtk-theme)" \
|
||||
"breeze-gtk-theme" "Breeze GTK theme (KDE port)" "$(_state breeze-gtk-theme)" \
|
||||
"greybird-gtk-theme" "Greybird GTK theme" "$(_state greybird-gtk-theme)" \
|
||||
"numix-gtk-theme" "Numix GTK theme" "$(_state numix-gtk-theme)" \
|
||||
"numix-gtk-theme" "Numix GTK theme" "$(_state numix-gtk-theme)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
|
||||
done
|
||||
@@ -115,10 +118,11 @@ _cat_icons_bullseye() {
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Icon Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}" )
|
||||
"${items[@]}")
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
|
||||
done
|
||||
@@ -129,16 +133,18 @@ _cat_cursors_bullseye() {
|
||||
local item_count=5
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Cursor Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Cursor Themes (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"breeze-cursor-theme" "Breeze cursors (KDE)" "$(_state breeze-cursor-theme)" \
|
||||
"chameleon-cursor-theme" "Chameleon cursors" "$(_state chameleon-cursor-theme)" \
|
||||
"dmz-cursor-theme" "DMZ cursors" "$(_state dmz-cursor-theme)" \
|
||||
"oxygencursors" "Oxygen cursors (KDE legacy)" "$(_state oxygencursors)" \
|
||||
"xcursor-themes" "X11 base cursors" "$(_state xcursor-themes)" \
|
||||
"xcursor-themes" "X11 base cursors" "$(_state xcursor-themes)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
|
||||
done
|
||||
@@ -149,15 +155,17 @@ _cat_fonts_bullseye() {
|
||||
local item_count=4
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Fonts (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Fonts (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"fonts-firacode" "Fira Code monospace font" "$(_state fonts-firacode)" \
|
||||
"fonts-noto" "Noto fonts (Google)" "$(_state fonts-noto)" \
|
||||
"fonts-dejavu-core" "DejaVu core fonts" "$(_state fonts-dejavu-core)" \
|
||||
"ttf-mscorefonts-installer" "Microsoft Core Fonts" "$(_state ttf-mscorefonts-installer)" \
|
||||
"ttf-mscorefonts-installer" "Microsoft Core Fonts" "$(_state ttf-mscorefonts-installer)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
! is_installed "$pkg" && _run_install "$pkg" || echo "$pkg already installed."
|
||||
done
|
||||
@@ -169,15 +177,17 @@ _cat_download_bullseye() {
|
||||
|
||||
local item_count1=2
|
||||
local lista_alto1=$((item_count1 > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count1))
|
||||
choices1=$(_checklist "Downloaders" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto1 \
|
||||
choices1=$(
|
||||
_checklist "Downloaders" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto1 \
|
||||
"aria2" "Multiprotocol downloader (CLI)" "$(_state aria2)" \
|
||||
"filezilla" "FTP/SFTP client (GUI)" "$(_state filezilla)" \
|
||||
"filezilla" "FTP/SFTP client (GUI)" "$(_state filezilla)"
|
||||
)
|
||||
clear
|
||||
|
||||
local item_count2=8
|
||||
local lista_alto2=$((item_count2 > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count2))
|
||||
choices2=$(_checklist "Torrent Clients" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto2 \
|
||||
choices2=$(
|
||||
_checklist "Torrent Clients" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto2 \
|
||||
"deluge" "BitTorrent client (GTK)" "$(_state deluge)" \
|
||||
"deluged" "BitTorrent daemon/server" "$(_state deluged)" \
|
||||
"mktorrent" "Torrent metainfo creator (CLI)" "$(_state mktorrent)" \
|
||||
@@ -185,13 +195,16 @@ _cat_download_bullseye() {
|
||||
"qbittorrent-nox" "BitTorrent WebUI/CLI" "$(_state qbittorrent-nox)" \
|
||||
"transmission-cli" "BitTorrent client (CLI)" "$(_state transmission-cli)" \
|
||||
"transmission-gtk" "BitTorrent client (GTK)" "$(_state transmission-gtk)" \
|
||||
"transmission-qt" "BitTorrent client (Qt)" "$(_state transmission-qt)" \
|
||||
"transmission-qt" "BitTorrent client (Qt)" "$(_state transmission-qt)"
|
||||
)
|
||||
clear
|
||||
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices1 $choices2" | tr -d '"')
|
||||
[ -z "$cleaned" ] && { echo "No download tools selected."; return; }
|
||||
[ -z "$cleaned" ] && {
|
||||
echo "No download tools selected."
|
||||
return
|
||||
}
|
||||
|
||||
for pkg in $cleaned; do
|
||||
if ! is_installed "$pkg"; then
|
||||
@@ -207,7 +220,8 @@ _cat_internet_bullseye() {
|
||||
local item_count=11
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Internet (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Internet (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"chromium" "Chromium web browser" "$(_state chromium)" \
|
||||
"dillo" "Lightweight graphical browser" "$(_state dillo)" \
|
||||
"elinks" "Text-mode web browser" "$(_state elinks)" \
|
||||
@@ -218,11 +232,12 @@ _cat_internet_bullseye() {
|
||||
"qutebrowser" "Keyboard-driven browser (Qt)" "$(_state qutebrowser)" \
|
||||
"thunderbird" "Email client" "$(_state thunderbird)" \
|
||||
"torbrowser-launcher" "Tor Browser launcher" "$(_state torbrowser-launcher)" \
|
||||
"w3m" "Text-mode browser + deps" "$(_state w3m)" \
|
||||
"w3m" "Text-mode browser + deps" "$(_state w3m)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
w3m)
|
||||
@@ -249,13 +264,15 @@ _cat_players_bullseye() {
|
||||
local item_count=2
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Media Players (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Media Players (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"mpv" "Lightweight media player" "$(_state mpv)" \
|
||||
"vlc" "VLC media player" "$(_state vlc)" \
|
||||
"vlc" "VLC media player" "$(_state vlc)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
if ! is_installed "$pkg"; then
|
||||
_run_install "$pkg"
|
||||
@@ -270,7 +287,8 @@ _cat_design_bullseye() {
|
||||
local item_count=13
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Multimedia & Design (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Multimedia & Design (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"ardour" "Digital audio workstation" "$(_state ardour)" \
|
||||
"audacity" "Audio editor/recorder" "$(_state audacity)" \
|
||||
"blender" "3D modeling/animation suite" "$(_state blender)" \
|
||||
@@ -283,11 +301,12 @@ _cat_design_bullseye() {
|
||||
"obs-studio" "Screen recording/streaming" "$(_state obs-studio)" \
|
||||
"openshot-qt" "Video editor (simple)" "$(_state openshot-qt)" \
|
||||
"scribus" "Desktop publishing (DTP)" "$(_state scribus)" \
|
||||
"shotcut" "Video editor (cross-platform)" "$(_state shotcut)" \
|
||||
"shotcut" "Video editor (cross-platform)" "$(_state shotcut)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
if ! is_installed "$pkg"; then
|
||||
_run_install "$pkg"
|
||||
@@ -302,7 +321,8 @@ _cat_programming_bullseye() {
|
||||
local item_count=9
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Code Editors & IDEs (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Code Editors & IDEs (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"vim" "Classic terminal editor" "$(_state vim)" \
|
||||
"vim-gtk3" "Vim with GTK3 GUI" "$(_state vim-gtk3)" \
|
||||
"neovim" "Modern vim fork" "$(_state neovim)" \
|
||||
@@ -311,11 +331,12 @@ _cat_programming_bullseye() {
|
||||
"kate" "KDE advanced text editor" "$(_state kate)" \
|
||||
"mousepad" "Xfce text editor" "$(_state mousepad)" \
|
||||
"gedit" "GNOME text editor" "$(_state gedit)" \
|
||||
"geany" "Lightweight IDE" "$(_state geany)" \
|
||||
"geany" "Lightweight IDE" "$(_state geany)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
if ! is_installed "$pkg"; then
|
||||
_run_install "$pkg"
|
||||
@@ -330,7 +351,8 @@ _cat_dev_bullseye() {
|
||||
local item_count=14
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Servers & Dev Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Servers & Dev Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"apache2" "Apache web server" "$(_state apache2)" \
|
||||
"build-essential" "C/C++ build tools (gcc, make)" "$(_state build-essential)" \
|
||||
"docker" "Docker container runtime" "$(_state docker.io)" \
|
||||
@@ -344,11 +366,12 @@ _cat_dev_bullseye() {
|
||||
"redis-server" "Redis key-value store" "$(_state redis-server)" \
|
||||
"sqlite3" "SQLite database engine" "$(_state sqlite3)" \
|
||||
"jellyfin" "Jellyfin Media Server (Web GUI on port 8096)" OFF \
|
||||
"openjdk-dev-env" "Adoptium Temurin JDK (17, 21, 25 LTS)$(_any_jdk_installed_desc)" "$(_any_jdk_state)" \
|
||||
"openjdk-dev-env" "Adoptium Temurin JDK (17, 21, 25 LTS)$(_any_jdk_installed_desc)" "$(_any_jdk_state)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
docker)
|
||||
@@ -394,16 +417,18 @@ _cat_security_bullseye() {
|
||||
local item_count=5
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Security & Networking (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "Security & Networking (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"wireshark" "Network protocol analyzer (GUI)" "$(_state wireshark)" \
|
||||
"tcpdump" "Command-line packet analyzer" "$(_state tcpdump)" \
|
||||
"fail2ban" "Brute-force protection daemon" "$(_state fail2ban)" \
|
||||
"ufw" "Uncomplicated firewall" "$(_state ufw)" \
|
||||
"clamav" "Antivirus engine (ClamAV)" "$(_state clamav)" \
|
||||
"clamav" "Antivirus engine (ClamAV)" "$(_state clamav)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
clamav)
|
||||
@@ -425,9 +450,10 @@ _cat_general_bullseye() {
|
||||
local item_count=22
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "System Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
choices=$(
|
||||
_checklist "System Tools (Bullseye)" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"compress" "Compression tools (zip, unrar, p7zip)" "$(_state zip)" \
|
||||
"conky" "System monitor for desktop" "$(_state conky)" \
|
||||
"conky-all" "System monitor for desktop" "$(_state conky-all)" \
|
||||
"cpu-x" "CPU-X (alternative to CPU-Z)" "$(_state cpu-x)" \
|
||||
"curl-wget" "HTTP transfer tools (curl, wget)" "$(_state curl)" \
|
||||
"flatpak" "Flatpak sandbox (Bullseye native)" "$(_state flatpak)" \
|
||||
@@ -447,11 +473,12 @@ _cat_general_bullseye() {
|
||||
"tmux" "Terminal multiplexer" "$(_state tmux)" \
|
||||
"wine" "Windows compatibility layer" "$(_state wine)" \
|
||||
"bleachbit" "System cleaner (GUI)" "$(_state bleachbit)" \
|
||||
"gdebi" "Install .deb packages with deps (GUI)" "$(_state gdebi)" \
|
||||
"gdebi" "Install .deb packages with deps (GUI)" "$(_state gdebi)"
|
||||
)
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
compress)
|
||||
@@ -539,10 +566,11 @@ _cat_fetch_bullseye() {
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Fetch Tools (Bullseye)" "Select system info tools:" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}" )
|
||||
"${items[@]}")
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
if ! is_installed "$pkg"; then
|
||||
_run_install "$pkg"
|
||||
@@ -562,7 +590,8 @@ install_extras_bullseye() {
|
||||
|
||||
while true; do
|
||||
local cat_choice
|
||||
cat_choice=$(_menu "Extra Software — Bullseye" "Select a category:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
|
||||
cat_choice=$(
|
||||
_menu "Extra Software — Bullseye" "Select a category:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
|
||||
"0" "Essential Pack" \
|
||||
"1" "Customization System" \
|
||||
"2" "Download & Network" \
|
||||
@@ -576,7 +605,7 @@ install_extras_bullseye() {
|
||||
"10" "Software Centers" \
|
||||
"11" "System Tools" \
|
||||
"12" "Fetch / System Info" \
|
||||
"13" "Back to main menu" \
|
||||
"13" "Back to main menu"
|
||||
)
|
||||
|
||||
[ -z "$cat_choice" ] && return
|
||||
@@ -604,10 +633,11 @@ install_extras_bullseye() {
|
||||
|
||||
_cat_software_centers_bullseye() {
|
||||
local sc_choice
|
||||
sc_choice=$(_menu "Software Centers" "Choose a software store to install:" 12 65 3 \
|
||||
sc_choice=$(
|
||||
_menu "Software Centers" "Choose a software store to install:" 12 65 3 \
|
||||
"gnome-software" "Software Center for GNOME" \
|
||||
"plasma-discover" "Software manager for Plasma" \
|
||||
"synaptic" "Classic APT package manager (GTK)" \
|
||||
"synaptic" "Classic APT package manager (GTK)"
|
||||
)
|
||||
[ -z "$sc_choice" ] && return
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ check_bullseye_archive_phase() {
|
||||
current_year=$(date +%Y)
|
||||
current_month=$(date +%-m)
|
||||
|
||||
if [ "$current_year" -gt 2026 ] || \
|
||||
if [ "$current_year" -gt 2026 ] ||
|
||||
{ [ "$current_year" -eq 2026 ] && [ "$current_month" -ge 9 ]; }; then
|
||||
BULLSEYE_USE_ARCHIVE=true
|
||||
fi
|
||||
@@ -33,7 +33,8 @@ No security updates will be available." 12 60
|
||||
install_nvidia_bullseye() {
|
||||
echo -e "${YELLOW}NVIDIA GPU detected (Bullseye mode).${NC}"
|
||||
|
||||
local is_fermi; is_fermi=$(is_nvidia_fermi)
|
||||
local is_fermi
|
||||
is_fermi=$(is_nvidia_fermi)
|
||||
|
||||
local nv_pkg=""
|
||||
local gpu_gen=""
|
||||
@@ -128,7 +129,7 @@ install_gaming_bullseye() {
|
||||
|
||||
local need_32bit=false
|
||||
for p in $cleaned; do
|
||||
case $p in steam|lutris) need_32bit=true ;; esac
|
||||
case $p in steam | lutris) need_32bit=true ;; esac
|
||||
done
|
||||
echo "$cleaned" | grep -qw i386 && need_32bit=true
|
||||
|
||||
@@ -139,7 +140,7 @@ install_gaming_bullseye() {
|
||||
if $need_32bit && ! dpkg --print-foreign-architectures 2>/dev/null | grep -q i386; then
|
||||
echo -e "${YELLOW}Enabling i386 architecture...${NC}"
|
||||
sudo dpkg --add-architecture i386
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
fi
|
||||
|
||||
if $need_32bit; then
|
||||
|
||||
@@ -233,7 +233,7 @@ lightdm_config_menu() {
|
||||
local conf="/etc/lightdm/lightdm.conf.d/50-debianito-userlist.conf"
|
||||
sudo mkdir -p "$(dirname "$conf")"
|
||||
if echo "[Seat:*]
|
||||
greeter-hide-users=false" | sudo tee "$conf" > /dev/null; then
|
||||
greeter-hide-users=false" | sudo tee "$conf" >/dev/null; then
|
||||
echo -e "${GREEN}User list enabled in LightDM.${NC}"
|
||||
else
|
||||
echo -e "${RED}Failed to write configuration.${NC}"
|
||||
@@ -281,7 +281,7 @@ configure_greetd() {
|
||||
if [ "$DEBIAN_VERSION" = "12" ]; then
|
||||
if [ "$(is_backports_enabled)" != true ]; then
|
||||
_write_deb822_backports "bookworm"
|
||||
sudo apt update -qq
|
||||
_ensure_apt_updated
|
||||
fi
|
||||
_run_cmd "greetd" "sudo apt install -y -t bookworm-backports tuigreet greetd" "Installing greetd + tuigreet..."
|
||||
else
|
||||
@@ -419,7 +419,7 @@ configure_sddm() {
|
||||
sddm_session="lxqt"
|
||||
fi
|
||||
sudo mkdir -p /etc/sddm.conf.d
|
||||
cat << EOF | sudo tee /etc/sddm.conf.d/autologin.conf > /dev/null
|
||||
cat <<EOF | sudo tee /etc/sddm.conf.d/autologin.conf >/dev/null
|
||||
[Autologin]
|
||||
User=${sddm_user}
|
||||
Session=${sddm_session}
|
||||
|
||||
@@ -6,7 +6,7 @@ _install_signal() {
|
||||
if [ ! -f /etc/apt/sources.list.d/extrepo_signal.sources ]; then
|
||||
_run_cmd "Signal" "sudo extrepo enable signal" "Enabling Signal repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
if ! is_installed "signal-desktop"; then
|
||||
_run_cmd "Signal" "sudo apt install -y signal-desktop" "Installing Signal..."
|
||||
echo -e "${GREEN}Signal installed.${NC}"
|
||||
@@ -50,9 +50,12 @@ _cat_communication() {
|
||||
fi
|
||||
|
||||
local -a items=()
|
||||
local signal_state; signal_state=$(_state "signal-desktop")
|
||||
local telegram_state; telegram_state=$(_state "telegram-desktop")
|
||||
local hexchat_state; hexchat_state=$(_state "hexchat")
|
||||
local signal_state
|
||||
signal_state=$(_state "signal-desktop")
|
||||
local telegram_state
|
||||
telegram_state=$(_state "telegram-desktop")
|
||||
local hexchat_state
|
||||
hexchat_state=$(_state "hexchat")
|
||||
items+=(
|
||||
"signal-desktop" "Signal Private Messenger (extrepo)" "$signal_state"
|
||||
"telegram-desktop" "Telegram Desktop messaging" "$telegram_state"
|
||||
@@ -67,7 +70,8 @@ _cat_communication() {
|
||||
clear
|
||||
[ -z "$choices" ] && return
|
||||
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
signal-desktop) _install_signal ;;
|
||||
|
||||
@@ -8,7 +8,7 @@ _enable_jellyfin_repo() {
|
||||
fi
|
||||
_run_cmd "Jellyfin" "sudo extrepo enable jellyfin" "Enabling Jellyfin repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
install_jellyfin() {
|
||||
|
||||
@@ -16,13 +16,13 @@ _enable_mozilla_repo() {
|
||||
_run_cmd "Mozilla" "sudo extrepo enable mozilla" "Enabling Mozilla repository..."
|
||||
fi
|
||||
if [ ! -f /etc/apt/preferences.d/mozilla ]; then
|
||||
sudo tee /etc/apt/preferences.d/mozilla > /dev/null << 'EOF'
|
||||
sudo tee /etc/apt/preferences.d/mozilla >/dev/null <<'EOF'
|
||||
Package: *
|
||||
Pin: origin packages.mozilla.org
|
||||
Pin-Priority: 1000
|
||||
EOF
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
_enable_floorp_repo() {
|
||||
@@ -30,7 +30,7 @@ _enable_floorp_repo() {
|
||||
_ensure_extrepo
|
||||
_run_cmd "Floorp" "sudo extrepo enable floorp" "Enabling Floorp repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
install_palemoon() {
|
||||
@@ -60,7 +60,7 @@ install_palemoon() {
|
||||
else
|
||||
_ensure_extrepo
|
||||
_run_cmd "Pale Moon" "sudo extrepo enable ${REPO_PALEMOON}" "Enabling ${REPO_PALEMOON}..."
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
fi
|
||||
|
||||
if ! is_installed "palemoon"; then
|
||||
@@ -76,7 +76,7 @@ _enable_librewolf_repo() {
|
||||
_ensure_extrepo
|
||||
_run_cmd "LibreWolf" "sudo extrepo enable librewolf" "Enabling LibreWolf repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
_enable_tailscale_repo() {
|
||||
@@ -84,7 +84,7 @@ _enable_tailscale_repo() {
|
||||
_ensure_extrepo
|
||||
_run_cmd "Tailscale" "sudo extrepo enable tailscale" "Enabling Tailscale repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
_enable_mullvad_repo() {
|
||||
@@ -92,14 +92,14 @@ _enable_mullvad_repo() {
|
||||
_ensure_extrepo
|
||||
_run_cmd "Mullvad" "sudo extrepo enable mullvad" "Enabling Mullvad repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
install_protonvpn() {
|
||||
if [ ! -f /etc/apt/sources.list.d/extrepo_protonvpn.sources ]; then
|
||||
_ensure_extrepo
|
||||
_run_cmd "ProtonVPN" "sudo extrepo enable protonvpn stable" "Enabling ProtonVPN repository (stable suite)..."
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
else
|
||||
echo "ProtonVPN repository already enabled."
|
||||
fi
|
||||
@@ -119,26 +119,40 @@ _cat_internet() {
|
||||
_is_headless && headless=true
|
||||
local -a items=()
|
||||
if ! $headless; then
|
||||
local chromium_state; chromium_state=$(_state "chromium")
|
||||
local dillo_state; dillo_state=$(_state "dillo")
|
||||
local epiphany_state; epiphany_state=$(_state "epiphany-browser")
|
||||
local falkon_state; falkon_state=$(_state "falkon")
|
||||
local chromium_state
|
||||
chromium_state=$(_state "chromium")
|
||||
local dillo_state
|
||||
dillo_state=$(_state "dillo")
|
||||
local epiphany_state
|
||||
epiphany_state=$(_state "epiphany-browser")
|
||||
local falkon_state
|
||||
falkon_state=$(_state "falkon")
|
||||
local firefox_state="OFF"
|
||||
if command -v firefox &>/dev/null && ! is_installed "firefox-esr"; then
|
||||
firefox_state="ON"
|
||||
fi
|
||||
local firefox_esr_state
|
||||
firefox_esr_state=$(_state "firefox-esr")
|
||||
local floorp_state; floorp_state=$(_state "floorp")
|
||||
local konqueror_state; konqueror_state=$(_state "konqueror")
|
||||
local librewolf_state; librewolf_state=$(_state "librewolf")
|
||||
local palemoon_state; palemoon_state=$(_state "palemoon")
|
||||
local privacybrowser_state; privacybrowser_state=$(_state "privacybrowser")
|
||||
local qutebrowser_state; qutebrowser_state=$(_state "qutebrowser")
|
||||
local thunderbird_state; thunderbird_state=$(_state "thunderbird")
|
||||
local torbrowser_state; torbrowser_state=$(_state "torbrowser-launcher")
|
||||
local mullvadbrowser_state; mullvadbrowser_state=$(_state "mullvad-browser")
|
||||
local protonvpn_state; protonvpn_state=$(_state "protonvpn")
|
||||
local floorp_state
|
||||
floorp_state=$(_state "floorp")
|
||||
local konqueror_state
|
||||
konqueror_state=$(_state "konqueror")
|
||||
local librewolf_state
|
||||
librewolf_state=$(_state "librewolf")
|
||||
local palemoon_state
|
||||
palemoon_state=$(_state "palemoon")
|
||||
local privacybrowser_state
|
||||
privacybrowser_state=$(_state "privacybrowser")
|
||||
local qutebrowser_state
|
||||
qutebrowser_state=$(_state "qutebrowser")
|
||||
local thunderbird_state
|
||||
thunderbird_state=$(_state "thunderbird")
|
||||
local torbrowser_state
|
||||
torbrowser_state=$(_state "torbrowser-launcher")
|
||||
local mullvadbrowser_state
|
||||
mullvadbrowser_state=$(_state "mullvad-browser")
|
||||
local protonvpn_state
|
||||
protonvpn_state=$(_state "protonvpn")
|
||||
items+=(
|
||||
"chromium" "Chromium web browser" "$chromium_state"
|
||||
"dillo" "Lightweight graphical browser" "$dillo_state"
|
||||
@@ -158,11 +172,16 @@ _cat_internet() {
|
||||
"protonvpn" "ProtonVPN client" "$protonvpn_state"
|
||||
)
|
||||
fi
|
||||
local elinks_state; elinks_state=$(_state "elinks")
|
||||
local riseupvpn_state; riseupvpn_state=$(_state "riseup-vpn")
|
||||
local w3m_state; w3m_state=$(_state "w3m")
|
||||
local tailscale_state; tailscale_state=$(_state "tailscale")
|
||||
local mullvad_state; mullvad_state=$(_state "mullvad-vpn")
|
||||
local elinks_state
|
||||
elinks_state=$(_state "elinks")
|
||||
local riseupvpn_state
|
||||
riseupvpn_state=$(_state "riseup-vpn")
|
||||
local w3m_state
|
||||
w3m_state=$(_state "w3m")
|
||||
local tailscale_state
|
||||
tailscale_state=$(_state "tailscale")
|
||||
local mullvad_state
|
||||
mullvad_state=$(_state "mullvad-vpn")
|
||||
items+=(
|
||||
"elinks" "Text-mode web browser" "$elinks_state"
|
||||
"riseup-vpn" "Riseup VPN client" "$riseupvpn_state"
|
||||
@@ -174,14 +193,16 @@ _cat_internet() {
|
||||
local item_count=${#items[@]}
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Internet" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}" \
|
||||
choices=$(
|
||||
_checklist "Internet" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}"
|
||||
)
|
||||
clear
|
||||
|
||||
[ -z "$choices" ] && return
|
||||
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
|
||||
local has_firefox=false
|
||||
local has_firefox_esr=false
|
||||
|
||||
@@ -10,7 +10,7 @@ _enable_temurin_repo() {
|
||||
_run_cmd "extrepo" "sudo apt install -y extrepo" "Installing extrepo..."
|
||||
fi
|
||||
_run_cmd "Temurin" "sudo extrepo enable temurin" "Enabling Adoptium Temurin repository..."
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
install_minecraft_java() {
|
||||
@@ -21,7 +21,10 @@ install_minecraft_java() {
|
||||
"17" "Java 17 — Minecraft 1.17 to 1.20.4" ON \
|
||||
"21" "Java 21 — Modern Minecraft >= 1.20.5 & 1.21+" OFF \
|
||||
"25" "Java 25 — Minecraft 26+" OFF)
|
||||
[ -z "$choices" ] && { echo "No Java version selected."; return; }
|
||||
[ -z "$choices" ] && {
|
||||
echo "No Java version selected."
|
||||
return
|
||||
}
|
||||
_enable_temurin_repo
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
@@ -38,7 +41,10 @@ _install_dev_java() {
|
||||
"17" "Java 17 LTS Development Kit" \
|
||||
"21" "Java 21 LTS Development Kit" \
|
||||
"25" "Java 25 LTS Development Kit")
|
||||
[ -z "$ver" ] && { echo "No JDK version selected."; return; }
|
||||
[ -z "$ver" ] && {
|
||||
echo "No JDK version selected."
|
||||
return
|
||||
}
|
||||
_enable_temurin_repo
|
||||
_run_install "temurin-${ver}-jdk"
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ _enable_onlyoffice_repo() {
|
||||
fi
|
||||
_run_cmd "OnlyOffice" "sudo extrepo enable onlyoffice-desktopeditors" "Enabling OnlyOffice repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
install_onlyoffice() {
|
||||
@@ -36,7 +36,7 @@ install_joplin() {
|
||||
if [ ! -f /etc/apt/sources.list.d/extrepo_joplin.sources ]; then
|
||||
_run_cmd "Joplin" "sudo extrepo enable joplin" "Enabling Joplin repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
if ! is_installed "joplin"; then
|
||||
_run_cmd "Joplin" "sudo apt install -y joplin" "Installing Joplin..."
|
||||
echo -e "${GREEN}Joplin installed.${NC}"
|
||||
@@ -97,12 +97,14 @@ _cat_office() {
|
||||
local item_count=${#items[@]}
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Office & Productivity" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}" \
|
||||
choices=$(
|
||||
_checklist "Office & Productivity" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}"
|
||||
)
|
||||
|
||||
[ -z "$choices" ] && return
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
|
||||
@@ -5,11 +5,16 @@ _cat_programming() {
|
||||
local headless=false
|
||||
_is_headless && headless=true
|
||||
local -a items=()
|
||||
local vim_state; vim_state=$(_state "vim")
|
||||
local neovim_state; neovim_state=$(_state "neovim")
|
||||
local hx_state; hx_state=$(_state "hx")
|
||||
local nano_state; nano_state=$(_state "nano")
|
||||
local emacs_state; emacs_state=$(_state "emacs")
|
||||
local vim_state
|
||||
vim_state=$(_state "vim")
|
||||
local neovim_state
|
||||
neovim_state=$(_state "neovim")
|
||||
local hx_state
|
||||
hx_state=$(_state "hx")
|
||||
local nano_state
|
||||
nano_state=$(_state "nano")
|
||||
local emacs_state
|
||||
emacs_state=$(_state "emacs")
|
||||
items+=(
|
||||
"vim" "Classic terminal editor" "$vim_state"
|
||||
"neovim" "Modern vim fork" "$neovim_state"
|
||||
@@ -18,12 +23,18 @@ _cat_programming() {
|
||||
"emacs" "Extensible editor / IDE" "$emacs_state"
|
||||
)
|
||||
if ! $headless; then
|
||||
local vimgtk_state; vimgtk_state=$(_state "vim-gtk3")
|
||||
local kate_state; kate_state=$(_state "kate")
|
||||
local mousepad_state; mousepad_state=$(_state "mousepad")
|
||||
local gedit_state; gedit_state=$(_state "gedit")
|
||||
local geany_state; geany_state=$(_state "geany")
|
||||
local gte_state; gte_state=$(_state "gnome-text-editor")
|
||||
local vimgtk_state
|
||||
vimgtk_state=$(_state "vim-gtk3")
|
||||
local kate_state
|
||||
kate_state=$(_state "kate")
|
||||
local mousepad_state
|
||||
mousepad_state=$(_state "mousepad")
|
||||
local gedit_state
|
||||
gedit_state=$(_state "gedit")
|
||||
local geany_state
|
||||
geany_state=$(_state "geany")
|
||||
local gte_state
|
||||
gte_state=$(_state "gnome-text-editor")
|
||||
local codium_state="OFF"
|
||||
if command -v codium &>/dev/null; then
|
||||
codium_state="ON"
|
||||
@@ -42,14 +53,16 @@ _cat_programming() {
|
||||
local item_count=${#items[@]}
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "Programming Applications" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}" \
|
||||
choices=$(
|
||||
_checklist "Programming Applications" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}"
|
||||
)
|
||||
clear
|
||||
|
||||
[ -z "$choices" ] && return
|
||||
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
@@ -76,7 +89,7 @@ _enable_vscodium_repo() {
|
||||
fi
|
||||
_run_cmd "VSCodium" "sudo extrepo enable vscodium" "Enabling VSCodium repository..."
|
||||
fi
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
}
|
||||
|
||||
install_vscodium() {
|
||||
|
||||
@@ -7,10 +7,14 @@ _detect_desktop_type() {
|
||||
desktop="${desktop,,}"
|
||||
|
||||
case "$desktop" in
|
||||
*kde*|*lxqt*|*razor*|*plasma*)
|
||||
echo "qt"; return ;;
|
||||
*gnome*|*xfce*|*cinnamon*|*mate*|*lxde*|*budgie*|*sway*|*hyprland*|*i3*|*bspwm*|*openbox*|*fluxbox*)
|
||||
echo "gtk"; return ;;
|
||||
*kde* | *lxqt* | *razor* | *plasma*)
|
||||
echo "qt"
|
||||
return
|
||||
;;
|
||||
*gnome* | *xfce* | *cinnamon* | *mate* | *lxde* | *budgie* | *sway* | *hyprland* | *i3* | *bspwm* | *openbox* | *fluxbox*)
|
||||
echo "gtk"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "gtk"
|
||||
@@ -20,34 +24,50 @@ _cat_general() {
|
||||
local headless=false
|
||||
_is_headless && headless=true
|
||||
local -a items=()
|
||||
local btop_state; btop_state=$(_state "btop")
|
||||
local btop_state
|
||||
btop_state=$(_state "btop")
|
||||
local compress_state
|
||||
if is_installed "zip" && is_installed "unzip" && is_installed "p7zip-full"; then
|
||||
compress_state="ON"
|
||||
else
|
||||
compress_state="OFF"
|
||||
fi
|
||||
local cpufetch_state; cpufetch_state=$(_state "cpufetch")
|
||||
local cpu_x_state; cpu_x_state=$(_state "cpu-x")
|
||||
local cpufetch_state
|
||||
cpufetch_state=$(_state "cpufetch")
|
||||
local cpu_x_state
|
||||
cpu_x_state=$(_state "cpu-x")
|
||||
local curl_wget_state
|
||||
if is_installed "curl" && is_installed "wget"; then
|
||||
curl_wget_state="ON"
|
||||
else
|
||||
curl_wget_state="OFF"
|
||||
fi
|
||||
local extrepo_state; extrepo_state=$(_state "extrepo")
|
||||
local fwupd_state; fwupd_state=$(_state "fwupd")
|
||||
local htop_state; htop_state=$(_state "htop")
|
||||
local inxi_state; inxi_state=$(_state "inxi")
|
||||
local jq_state; jq_state=$(_state "jq")
|
||||
local kvm_state; kvm_state=$(_state "virt-manager")
|
||||
local lshw_state; lshw_state=$(_state "lshw")
|
||||
local mc_state; mc_state=$(_state "mc")
|
||||
local nala_state; nala_state=$(_state "nala")
|
||||
local ncdu_state; ncdu_state=$(_state "ncdu")
|
||||
local tmux_state; tmux_state=$(_state "tmux")
|
||||
local wine_state; wine_state=$(_state "wine")
|
||||
local nvme_state; nvme_state=$(_state "nvme-cli")
|
||||
local extrepo_state
|
||||
extrepo_state=$(_state "extrepo")
|
||||
local fwupd_state
|
||||
fwupd_state=$(_state "fwupd")
|
||||
local htop_state
|
||||
htop_state=$(_state "htop")
|
||||
local inxi_state
|
||||
inxi_state=$(_state "inxi")
|
||||
local jq_state
|
||||
jq_state=$(_state "jq")
|
||||
local kvm_state
|
||||
kvm_state=$(_state "virt-manager")
|
||||
local lshw_state
|
||||
lshw_state=$(_state "lshw")
|
||||
local mc_state
|
||||
mc_state=$(_state "mc")
|
||||
local nala_state
|
||||
nala_state=$(_state "nala")
|
||||
local ncdu_state
|
||||
ncdu_state=$(_state "ncdu")
|
||||
local tmux_state
|
||||
tmux_state=$(_state "tmux")
|
||||
local wine_state
|
||||
wine_state=$(_state "wine")
|
||||
local nvme_state
|
||||
nvme_state=$(_state "nvme-cli")
|
||||
items+=(
|
||||
"btop" "Resource monitor (fancy top)" "$btop_state"
|
||||
"compress" "Compression tools (zip, unrar, 7z)" "$compress_state"
|
||||
@@ -69,20 +89,31 @@ _cat_general() {
|
||||
"wine" "Windows compatibility layer" "$wine_state"
|
||||
)
|
||||
if ! $headless; then
|
||||
local bleachbit_state; bleachbit_state=$(_state "bleachbit")
|
||||
local conky_state; conky_state=$(_state "conky")
|
||||
local gdebi_state; gdebi_state=$(_state "gdebi")
|
||||
local corectrl_state; corectrl_state=$(_state "corectrl")
|
||||
local dcgtk_state; dcgtk_state=$(_state "doublecmd-gtk")
|
||||
local dcqt_state; dcqt_state=$(_state "doublecmd-qt")
|
||||
local disks_state; disks_state=$(_state "gnome-disk-utility")
|
||||
local gparted_state; gparted_state=$(_state "gparted")
|
||||
local hardinfo_state; hardinfo_state=$(_state "hardinfo")
|
||||
local psensor_state; psensor_state=$(_state "psensor")
|
||||
local timeshift_state; timeshift_state=$(_state "timeshift")
|
||||
local bleachbit_state
|
||||
bleachbit_state=$(_state "bleachbit")
|
||||
local conky_state
|
||||
conky_state=$(_state "conky-all")
|
||||
local gdebi_state
|
||||
gdebi_state=$(_state "gdebi")
|
||||
local corectrl_state
|
||||
corectrl_state=$(_state "corectrl")
|
||||
local dcgtk_state
|
||||
dcgtk_state=$(_state "doublecmd-gtk")
|
||||
local dcqt_state
|
||||
dcqt_state=$(_state "doublecmd-qt")
|
||||
local disks_state
|
||||
disks_state=$(_state "gnome-disk-utility")
|
||||
local gparted_state
|
||||
gparted_state=$(_state "gparted")
|
||||
local hardinfo_state
|
||||
hardinfo_state=$(_state "hardinfo")
|
||||
local psensor_state
|
||||
psensor_state=$(_state "psensor")
|
||||
local timeshift_state
|
||||
timeshift_state=$(_state "timeshift")
|
||||
items+=(
|
||||
"bleachbit" "System cleaner (GUI)" "$bleachbit_state"
|
||||
"conky" "System monitor for desktop" "$conky_state"
|
||||
"conky-all" "System monitor for desktop" "$conky_state"
|
||||
"gdebi" "Install .deb packages with deps" "$gdebi_state"
|
||||
"corectrl" "AMD GPU control (CoreCtrl)" "$corectrl_state"
|
||||
"doublecmd-gtk" "Dual-panel file manager (GTK)" "$dcgtk_state"
|
||||
@@ -98,14 +129,16 @@ _cat_general() {
|
||||
local item_count=${#items[@]}
|
||||
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
||||
local choices
|
||||
choices=$(_checklist "System Tools" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}" \
|
||||
choices=$(
|
||||
_checklist "System Tools" "Check [*] the packages you want installed/updated on your system.\n" $TUI_ALTO $TUI_ANCHO $lista_alto \
|
||||
"${items[@]}"
|
||||
)
|
||||
clear
|
||||
|
||||
[ -z "$choices" ] && return
|
||||
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
|
||||
for pkg in $cleaned; do
|
||||
case $pkg in
|
||||
@@ -240,4 +273,3 @@ _cat_general() {
|
||||
echo -e "${GREEN}System tools installed.${NC}"
|
||||
_pause
|
||||
}
|
||||
|
||||
|
||||
+33
-23
@@ -17,7 +17,7 @@ _detect_all_network_devices() {
|
||||
PCI_NET_DEVS=()
|
||||
while IFS= read -r line; do
|
||||
PCI_NET_DEVS+=("$line")
|
||||
done < <(timeout 2 lspci -nn 2>/dev/null | grep -iE 'network controller|ethernet controller' || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -iE 'network controller|ethernet controller' || true)
|
||||
|
||||
USB_WIFI_DEVS=()
|
||||
while IFS= read -r line; do
|
||||
@@ -29,7 +29,7 @@ _detect_all_network_devices() {
|
||||
PCI_BT_DEVS=()
|
||||
while IFS= read -r line; do
|
||||
PCI_BT_DEVS+=("$line")
|
||||
done < <(timeout 2 lspci -nn 2>/dev/null | grep -i 'Bluetooth controller' || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -i 'Bluetooth controller' || true)
|
||||
|
||||
USB_BT_DEVS=()
|
||||
while IFS= read -r line; do
|
||||
@@ -94,7 +94,7 @@ _detect_firmware_needs() {
|
||||
fi
|
||||
;;
|
||||
*realtek*) pkg="firmware-realtek" ;;
|
||||
*atheros*|*qualcomm*) pkg="firmware-atheros" ;;
|
||||
*atheros* | *qualcomm*) pkg="firmware-atheros" ;;
|
||||
*mediatek*) pkg="firmware-mediatek" ;;
|
||||
esac
|
||||
|
||||
@@ -153,7 +153,8 @@ _build_firmware_plan() {
|
||||
if ! $has_bt; then
|
||||
for dev in "${USB_WIFI_DEVS[@]}"; do
|
||||
if echo "$dev" | grep -qi 'bluetooth'; then
|
||||
has_bt=true; break
|
||||
has_bt=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -166,7 +167,8 @@ _build_firmware_plan() {
|
||||
plan+=" [+] bluez + bluez-tools + bluez-obexd (base stack)\n"
|
||||
fi
|
||||
case "${DESKTOP_ENV:-other}" in
|
||||
kde) plan+=" [+] bluedevil (KDE applet)\n"
|
||||
kde)
|
||||
plan+=" [+] bluedevil (KDE applet)\n"
|
||||
if [ "${AUDIO_SERVER:-}" = "pipewire" ]; then
|
||||
plan+=" → pipewire-pulse + wireplumber (if missing)\n"
|
||||
fi
|
||||
@@ -224,25 +226,35 @@ _handle_wireless() {
|
||||
[ -z "$bcm_id" ] && continue
|
||||
dev_id=$(echo "$bcm_id" | cut -d: -f2 | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# --- Verificación de headers ---
|
||||
if ! apt-cache policy linux-headers-amd64 2>/dev/null | grep -q "Candidate: [^ (none)]"; then
|
||||
_msg "Broadcom Error" "linux-headers-amd64 is not available. Cannot compile Broadcom driver.\n\nEnsure non-free repositories are enabled and run:\n sudo apt install linux-headers-amd64"
|
||||
# --- Dependencies verification ---
|
||||
if ! is_installed "linux-headers-amd64" || ! is_installed "dkms"; then
|
||||
if ! apt-cache show linux-headers-amd64 dkms >/dev/null 2>&1; then
|
||||
_msg "Broadcom Error" "linux-headers-amd64 or dkms are not available in your repositories. Cannot compile Broadcom driver.\n\nEnsure repositories are enabled and run:\n sudo apt install linux-headers-amd64 dkms"
|
||||
_pause
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- Confirmación ---
|
||||
local bcm_ver header_ver
|
||||
bcm_ver=$(apt-cache policy broadcom-sta-dkms 2>/dev/null | awk 'NR==3 {print $2}')
|
||||
header_ver=$(apt-cache policy linux-headers-amd64 2>/dev/null | awk 'NR==3 {print $2}')
|
||||
if ! _confirm "Broadcom WiFi" "Detected Broadcom wireless device.\n\nInstall broadcom-sta-dkms ${bcm_ver} + linux-headers-amd64 ${header_ver}?"; then
|
||||
# --- Confirmation ---
|
||||
if ! _confirm "Broadcom WiFi" "Detected Broadcom wireless device.\n\nInstall broadcom-sta-dkms, dkms, and wireless-tools?"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# --- Instalación ---
|
||||
_run_cmd "Broadcom" "sudo DEBIAN_FRONTEND=noninteractive apt install -y linux-headers-amd64 broadcom-sta-dkms" || true
|
||||
# --- Step-by-step installation ---
|
||||
_run_cmd "Broadcom Deps" "sudo DEBIAN_FRONTEND=noninteractive apt install -y dkms wireless-tools linux-headers-amd64" || true
|
||||
_run_cmd "Broadcom Driver" "sudo DEBIAN_FRONTEND=noninteractive apt install -y broadcom-sta-dkms" || true
|
||||
|
||||
# --- Combo BT (sin cambios respecto al código actual) ---
|
||||
# --- Persist blacklist of conflicting modules ---
|
||||
local blacklist_conf="/etc/modprobe.d/blacklist-broadcom.conf"
|
||||
local blacklist_content="blacklist b43\nblacklist b43legacy\nblacklist brcmsmac\nblacklist bcma\nblacklist ssb"
|
||||
echo -e "$blacklist_content" | sudo tee "$blacklist_conf" >/dev/null
|
||||
|
||||
# --- Update initramfs and load module ---
|
||||
_run_cmd "Initramfs" "sudo update-initramfs -u" || true
|
||||
_run_cmd "Modprobe" "sudo modprobe -r b43 b43legacy b44 bcma brcmsmac brcmfmac ssb wl 2>/dev/null || true" "Removing conflicting modules" || true
|
||||
_run_cmd "Modprobe" "sudo modprobe wl" || true
|
||||
|
||||
# --- Combo BT (unchanged) ---
|
||||
local has_broadcom_bt=false
|
||||
local btdev
|
||||
for btdev in "${PCI_BT_DEVS[@]}"; do
|
||||
@@ -258,13 +270,12 @@ _handle_wireless() {
|
||||
echo -e "${YELLOW} A reboot may be required for Bluetooth support.${NC}"
|
||||
fi
|
||||
|
||||
# --- Post-DKMS verification (Fix 5, sin cambios) ---
|
||||
# --- Post-DKMS verification (Fix 5, unchanged) ---
|
||||
if ! ls /lib/modules/$(uname -r)/updates/dkms/wl.ko* 2>/dev/null | grep -q .; then
|
||||
_msg "Broadcom DKMS Build Failed" "The wl module was not built by DKMS.\n\nPossible causes:\n- Missing build tools (build-essential, dkms)\n- Kernel update without headers\n- Incompatible kernel version\n\nTry: sudo dpkg-reconfigure broadcom-sta-dkms"
|
||||
if _confirm "Broadcom" "Rebuild the Broadcom driver now?"; then
|
||||
_run_cmd "Broadcom" "sudo dpkg-reconfigure broadcom-sta-dkms" || true
|
||||
if ls /lib/modules/$(uname -r)/updates/dkms/wl.ko* 2>/dev/null | grep -q .; then
|
||||
# wl.ko existe tras reconfigure → continuar a limpieza/carga
|
||||
:
|
||||
else
|
||||
local dmesg_out
|
||||
@@ -280,7 +291,6 @@ _handle_wireless() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- Limpieza de módulos conflictivos + carga wl (patrón Mint) ---
|
||||
sudo modprobe -r b43 b43legacy b44 bcma brcmsmac brcmfmac ssb wl 2>/dev/null || true
|
||||
sudo modprobe wl 2>/dev/null
|
||||
|
||||
@@ -297,7 +307,7 @@ _handle_wireless() {
|
||||
fi
|
||||
done
|
||||
|
||||
# --- USB Broadcom (sin cambios) ---
|
||||
# --- USB Broadcom (unchanged) ---
|
||||
local usb_dev
|
||||
for usb_dev in "${USB_WIFI_DEVS[@]}"; do
|
||||
if echo "$usb_dev" | grep -qi '0a5c'; then
|
||||
@@ -306,7 +316,7 @@ _handle_wireless() {
|
||||
fi
|
||||
done
|
||||
|
||||
# --- Mensaje final (sin cambios) ---
|
||||
# --- Mensaje final (unchanged) ---
|
||||
if ! $installed_any && ! $wl_build_failed; then
|
||||
echo "No special WiFi firmware needed -- base firmware-linux-nonfree covers this system."
|
||||
_pause
|
||||
@@ -387,7 +397,7 @@ _ensure_nonfree_repo() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
sudo apt update
|
||||
_ensure_apt_updated
|
||||
echo -e "${GREEN}non-free repository enabled.${NC}"
|
||||
return 0
|
||||
}
|
||||
@@ -419,7 +429,7 @@ install_firmware() {
|
||||
# 4. Install base firmware meta-package (unchanged logic)
|
||||
local fw_pkg="firmware-linux-nonfree"
|
||||
local fw_bpo
|
||||
fw_bpo=$(apt-cache madison "$fw_pkg" 2>/dev/null | \
|
||||
fw_bpo=$(apt-cache madison "$fw_pkg" 2>/dev/null |
|
||||
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
|
||||
|
||||
local fw_stable
|
||||
|
||||
+3
-3
@@ -60,7 +60,7 @@ ensure_contrib_repo() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
sudo apt update
|
||||
_ensure_apt_updated
|
||||
echo -e "${GREEN}contrib repository enabled.${NC}"
|
||||
return 0
|
||||
}
|
||||
@@ -95,7 +95,7 @@ install_gaming() {
|
||||
# 2. Determine if 32-bit is needed (steam, lutris, or explicit i386 toggle)
|
||||
local need_32bit=false
|
||||
for p in $cleaned; do
|
||||
case $p in steam|lutris) need_32bit=true ;; esac
|
||||
case $p in steam | lutris) need_32bit=true ;; esac
|
||||
done
|
||||
echo "$cleaned" | grep -qw i386 && need_32bit=true
|
||||
|
||||
@@ -108,7 +108,7 @@ install_gaming() {
|
||||
if $need_32bit && ! dpkg --print-foreign-architectures 2>/dev/null | grep -q i386; then
|
||||
echo -e "${YELLOW}Enabling i386 architecture (required by selection)...${NC}"
|
||||
sudo dpkg --add-architecture i386
|
||||
_run_cmd "APT Update" "sudo apt update" "Updating package lists..."
|
||||
_ensure_apt_updated
|
||||
fi
|
||||
|
||||
# 4. Install 32-bit graphics drivers only if 32-bit is needed
|
||||
|
||||
+14
-10
@@ -19,7 +19,7 @@ _warn_nvidia_gnome_wayland() {
|
||||
command -v gdm3 &>/dev/null || return 0
|
||||
gnome-shell --version 2>/dev/null | grep -qi "shell 4[0-9]" || return 0
|
||||
case "$NVIDIA_DRIVER_MODE" in
|
||||
stable|backports|cuda-repo|extrepo) ;;
|
||||
stable | backports | cuda-repo | extrepo) ;;
|
||||
*) return 0 ;;
|
||||
esac
|
||||
echo -e "${YELLOW}WARNING: Debian bug #1109409 may affect GDM3 + NVIDIA + Wayland.${NC}"
|
||||
@@ -33,7 +33,7 @@ _install_amd_intel_stack() {
|
||||
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 | \
|
||||
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)"
|
||||
|
||||
@@ -79,11 +79,13 @@ _install_amd_intel_stack() {
|
||||
local desc
|
||||
desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//')
|
||||
plan+=" GPU ${gpu_count}: ${desc}\n"
|
||||
done < <(timeout 2 lspci -nn | grep -E "VGA|3D" || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D" || true)
|
||||
plan+="\nPlanned components:\n"
|
||||
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"
|
||||
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
|
||||
@@ -154,7 +156,9 @@ _apply_amd_gcn_grub_fix() {
|
||||
|
||||
sudo cp "$file" "$backup"
|
||||
|
||||
sudo sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$*/${params}&/" "$file"
|
||||
if ! sudo grep -q "amdgpu.si_support=1" "$file"; then
|
||||
sudo sed -i -E "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"([^\"]*)\"/\"${params} \1\"/" "$file"
|
||||
fi
|
||||
|
||||
if _confirm "AMD GCN — GRUB" "Parameters added:\n\n ${params}\n\nRun update-grub now?" 12 65; then
|
||||
if sudo update-grub >/dev/null 2>&1; then
|
||||
@@ -183,7 +187,7 @@ _install_nvidia_stack() {
|
||||
local desc
|
||||
desc=$(echo "$gpu_line" | sed -E 's/.*: //; s/ *\(rev.*//')
|
||||
plan+=" GPU ${gpu_count}: ${desc}\n"
|
||||
done < <(timeout 2 lspci -nn | grep -E "VGA|3D" || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D" || true)
|
||||
plan+="\nPlanned:\n [+] NVIDIA proprietary driver"
|
||||
|
||||
_msg "NVIDIA Stack — Plan" "$plan" 14 65
|
||||
@@ -241,7 +245,7 @@ _install_nvidia_stack() {
|
||||
"Your Blackwell GPU is NOT supported by the official\nDebian v550 driver.\n\nPlease select v590 or v595 (NVIDIA CUDA Repo)\nin the driver menu." 14 65
|
||||
NVIDIA_DRIVER_MODE=""
|
||||
;;
|
||||
maxwell|pascal|volta)
|
||||
maxwell | pascal | volta)
|
||||
if [ "$(is_backports_kernel)" = "true" ]; then
|
||||
local gpu_gen="Maxwell"
|
||||
[ "$nv_arch" = "pascal" ] && gpu_gen="Pascal"
|
||||
@@ -262,7 +266,7 @@ Forcing the stable driver path." 14 70
|
||||
_install_nvidia_standard
|
||||
fi
|
||||
;;
|
||||
turing|ampere|ada)
|
||||
turing | ampere | ada)
|
||||
_install_nvidia_standard
|
||||
;;
|
||||
*)
|
||||
@@ -274,7 +278,7 @@ Forcing the stable driver path." 14 70
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
590|595)
|
||||
590 | 595)
|
||||
nv_arch=$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")
|
||||
if [ "$nv_arch" = "maxwell" ] || [ "$nv_arch" = "pascal" ] || [ "$nv_arch" = "legacy" ]; then
|
||||
local gpu_gen="Kepler/Fermi"
|
||||
|
||||
+15
-9
@@ -23,7 +23,10 @@ declare -A NVIDIA_FAMILY_MAP=(
|
||||
)
|
||||
|
||||
detect_nvidia_arch() {
|
||||
[ -z "$1" ] && { echo "unknown"; return; }
|
||||
[ -z "$1" ] && {
|
||||
echo "unknown"
|
||||
return
|
||||
}
|
||||
local pci_id="${1^^}"
|
||||
local prefix="${pci_id:0:2}"
|
||||
echo "${NVIDIA_FAMILY_MAP[$prefix]:-unknown}"
|
||||
@@ -65,12 +68,15 @@ is_nvidia_volta() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arc
|
||||
is_nvidia_turing() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "turing" ]] && echo true || echo false; }
|
||||
is_nvidia_ampere() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "ampere" ]] && echo true || echo false; }
|
||||
is_nvidia_ada() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "ada" ]] && echo true || echo false; }
|
||||
is_nvidia_blackwell(){ [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "blackwell" ]] && echo true || echo false; }
|
||||
is_nvidia_blackwell() { [ -n "$NVIDIA_GPU_DEVICE_ID" ] && [[ "$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")" == "blackwell" ]] && echo true || echo false; }
|
||||
|
||||
is_amd_legacy_gcn() {
|
||||
local dev_id
|
||||
dev_id=$(timeout 2 lspci -nn | grep -iE "VGA|3D" | grep -i amd | grep -oP '1002:\K[0-9a-fA-F]{4}' | head -n1)
|
||||
[ -z "$dev_id" ] && { echo false; return; }
|
||||
dev_id=$(echo "$LSPCI_OUTPUT" | grep -iE "VGA|3D" | grep -i amd | grep -oP '1002:\K[0-9a-fA-F]{4}' | head -n1)
|
||||
[ -z "$dev_id" ] && {
|
||||
echo false
|
||||
return
|
||||
}
|
||||
|
||||
local legacy_ids
|
||||
legacy_ids="6660|6664|6665|6667|6780|6784|6788|678a|6798|679a|679e|679f|3000|3001|6808|6809|6810|6811|6816|6817|6818|6819|6828|6829|682b|682c|6835|6837|683d|683f|6608|6609|6610|6611|6613|6617|1dcf|983d|6646|6649|664d|6650|6651|6658|665c|665d|67a0|67a1|67a2|67a8|67a9|67aa|67b0|67b1|67b8|67be|9830|9831|9832|9833|9834|9835|9836|9837|9838|9839|1304|1305|1306|1307|1309|130a|130b|130c|130d|130e|130f|1310|1311|1312|1313|1315|1316|1317|1318|131b|131c|131d|9850|9851|9852|9853|9854|9855|9856|9857|9858|9859|985a|985b|985c|985d|985e|985f"
|
||||
@@ -94,7 +100,7 @@ _install_mesa_backports() {
|
||||
|
||||
for mpkg in "${mesa_pkgs[@]}"; do
|
||||
local bpo_ver
|
||||
bpo_ver=$(apt-cache madison "$mpkg" 2>/dev/null | \
|
||||
bpo_ver=$(apt-cache madison "$mpkg" 2>/dev/null |
|
||||
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
|
||||
if [ -n "$bpo_ver" ]; then
|
||||
bpo_pkgs+=("$mpkg")
|
||||
@@ -114,7 +120,7 @@ _install_mesa_backports() {
|
||||
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 | \
|
||||
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)"
|
||||
|
||||
@@ -176,17 +182,17 @@ offer_generic_tools() {
|
||||
|
||||
_is_hybrid_laptop() {
|
||||
local gpu_count nvidia_count chassis
|
||||
gpu_count=$(lspci -nn 2>/dev/null | grep -ciE "VGA compatible|3D controller") || true
|
||||
gpu_count=$(echo "$LSPCI_OUTPUT" | grep -ciE "VGA compatible|3D controller") || true
|
||||
[ "$gpu_count" -lt 2 ] && return 1
|
||||
|
||||
# Defensa en profundidad: si TODAS las GPUs son NVIDIA (SLI o
|
||||
# dual-GPU desktop), no hay iGPU Intel/AMD → no es híbrida.
|
||||
nvidia_count=$(lspci -nn 2>/dev/null | grep -iE "VGA compatible|3D controller" | grep -c "10de:") || true
|
||||
nvidia_count=$(echo "$LSPCI_OUTPUT" | grep -iE "VGA compatible|3D controller" | grep -c "10de:") || true
|
||||
[ "$nvidia_count" -ge "$gpu_count" ] && return 1
|
||||
|
||||
chassis=$(cat /sys/class/dmi/id/chassis_type 2>/dev/null || echo "0")
|
||||
case "$chassis" in
|
||||
8|9|10|11|14|30|31|32) return 0 ;;
|
||||
8 | 9 | 10 | 11 | 14 | 30 | 31 | 32) return 0 ;;
|
||||
esac
|
||||
|
||||
ls /sys/class/power_supply/ 2>/dev/null | grep -q "^BAT" && return 0
|
||||
|
||||
+17
-14
@@ -103,7 +103,7 @@ _write_deb822() {
|
||||
if content_differs "$main_file" "$main_content"; then
|
||||
if _confirm "Deb822 Sources" "Write main deb822 configuration to ${main_file}?"; then
|
||||
sudo mkdir -p /etc/apt/sources.list.d
|
||||
echo -e "$main_content" | sudo tee "$main_file" > /dev/null
|
||||
echo -e "$main_content" | sudo tee "$main_file" >/dev/null
|
||||
echo "Wrote ${main_file}"
|
||||
else
|
||||
echo "Main repository configuration skipped."
|
||||
@@ -146,7 +146,7 @@ _write_deb822_backports() {
|
||||
if content_differs "$bp_file" "$bp_content"; then
|
||||
if _confirm "Deb822 Backports" "Write backports to ${bp_file}?"; then
|
||||
sudo mkdir -p /etc/apt/sources.list.d
|
||||
echo -e "$bp_content" | sudo tee "$bp_file" > /dev/null
|
||||
echo -e "$bp_content" | sudo tee "$bp_file" >/dev/null
|
||||
echo "Wrote ${bp_file}"
|
||||
else
|
||||
return 1
|
||||
@@ -154,7 +154,7 @@ _write_deb822_backports() {
|
||||
fi
|
||||
|
||||
# If backports were formerly embedded in debian.sources, clean them
|
||||
grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null && \
|
||||
grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null &&
|
||||
_clean_embedded_backports_deb822 "$codename" || true
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ _remove_deb822_backports() {
|
||||
fi
|
||||
|
||||
# Also clean any embedded backports in main debian.sources
|
||||
grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null && \
|
||||
grep -qE "^Suites:.*${codename}-backports\b" /etc/apt/sources.list.d/debian.sources 2>/dev/null &&
|
||||
_clean_embedded_backports_deb822 "$codename"
|
||||
|
||||
# Clean embedded backports from classic file too (safety net)
|
||||
@@ -199,7 +199,7 @@ _write_classic() {
|
||||
|
||||
if content_differs "$main_file" "$main_content"; then
|
||||
if _confirm "Classic Sources" "Write main classic configuration to ${main_file}?"; then
|
||||
echo -e "$main_content" | sudo tee "$main_file" > /dev/null
|
||||
echo -e "$main_content" | sudo tee "$main_file" >/dev/null
|
||||
echo "Wrote ${main_file}"
|
||||
else
|
||||
echo "Main repository configuration skipped."
|
||||
@@ -240,7 +240,7 @@ _write_classic_backports() {
|
||||
if content_differs "$bp_file" "$bp_content"; then
|
||||
if _confirm "Classic Backports" "Write backports to ${bp_file}?"; then
|
||||
sudo mkdir -p /etc/apt/sources.list.d
|
||||
echo -e "$bp_content" | sudo tee "$bp_file" > /dev/null
|
||||
echo -e "$bp_content" | sudo tee "$bp_file" >/dev/null
|
||||
echo "Wrote ${bp_file}"
|
||||
else
|
||||
return 1
|
||||
@@ -248,7 +248,7 @@ _write_classic_backports() {
|
||||
fi
|
||||
|
||||
# If backports were formerly embedded in sources.list, clean them
|
||||
grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null && \
|
||||
grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null &&
|
||||
_clean_embedded_backports_classic "$codename" || true
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ _remove_classic_backports() {
|
||||
fi
|
||||
|
||||
# Also clean any embedded backports in main sources.list
|
||||
grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null && \
|
||||
grep -qE "^[^#]*${codename}-backports\b" /etc/apt/sources.list 2>/dev/null &&
|
||||
_clean_embedded_backports_classic "$codename"
|
||||
|
||||
# Clean embedded backports from deb822 file too (safety net)
|
||||
@@ -410,9 +410,15 @@ Adding deb.debian.org may duplicate your current mirror configuration. Continue?
|
||||
fi
|
||||
|
||||
if $use_deb822; then
|
||||
_write_deb822 "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || { cleanup_repo_backup; return 1; }
|
||||
_write_deb822 "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || {
|
||||
cleanup_repo_backup
|
||||
return 1
|
||||
}
|
||||
else
|
||||
_write_classic "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || { cleanup_repo_backup; return 1; }
|
||||
_write_classic "$DEBIAN_CODENAME" "write" "$bp_enabled" "$bp_location" "$components" || {
|
||||
cleanup_repo_backup
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
|
||||
# Tidy: with deb822 chosen, an empty classic file is no longer needed
|
||||
@@ -425,7 +431,6 @@ Adding deb.debian.org may duplicate your current mirror configuration. Continue?
|
||||
|
||||
echo "Updating package lists..."
|
||||
if sudo apt update; then
|
||||
REPOS_CONFIGURED=true
|
||||
cleanup_repo_backup
|
||||
echo -e "${GREEN}Repository components configured.${NC}"
|
||||
return 0
|
||||
@@ -514,7 +519,6 @@ Writing debian.sources may duplicate your configuration. Continue?" 10 65; then
|
||||
|
||||
echo "Updating package lists..."
|
||||
if sudo apt update; then
|
||||
REPOS_CONFIGURED=true
|
||||
cleanup_repo_backup
|
||||
echo -e "${GREEN}Repository components configured.${NC}"
|
||||
_repos_offer_upgrade
|
||||
@@ -558,7 +562,6 @@ _repos_migrate_format() {
|
||||
|
||||
echo "Updating package lists..."
|
||||
if sudo apt update; then
|
||||
REPOS_CONFIGURED=true
|
||||
cleanup_repo_backup
|
||||
echo -e "${GREEN}Repository format migrated to DEB822.${NC}"
|
||||
else
|
||||
@@ -589,7 +592,7 @@ Answer NO to disable or remove backports if they are currently enabled." 16 70;
|
||||
fi
|
||||
|
||||
# Nothing to do — already in desired state
|
||||
if { $enable_backports && [ "$bp_status" = "enabled" ]; } || \
|
||||
if { $enable_backports && [ "$bp_status" = "enabled" ]; } ||
|
||||
{ ! $enable_backports && [ "$bp_status" = "disabled" ]; }; then
|
||||
echo "Backports are already configured as requested."
|
||||
_pause
|
||||
|
||||
@@ -73,8 +73,12 @@ Useful for automation but reduces security." 14 70; then
|
||||
"power" "Shutdown, reboot, halt" ON)
|
||||
clear
|
||||
|
||||
[ -z "$choices" ] && { echo "No commands selected."; return; }
|
||||
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
||||
[ -z "$choices" ] && {
|
||||
echo "No commands selected."
|
||||
return
|
||||
}
|
||||
local cleaned
|
||||
cleaned=$(echo "$choices" | tr -d '"')
|
||||
|
||||
local content=""
|
||||
for cmd in $cleaned; do
|
||||
@@ -91,7 +95,8 @@ Useful for automation but reduces security." 14 70; then
|
||||
esac
|
||||
done
|
||||
|
||||
local content_str; content_str=$(echo -e "$content")
|
||||
local content_str
|
||||
content_str=$(echo -e "$content")
|
||||
if _validate_sudoers "$content_str" "$nopasswd_file"; then
|
||||
echo -e "${GREEN}Passwordless sudo configured for selected commands.${NC}"
|
||||
else
|
||||
@@ -103,7 +108,7 @@ Useful for automation but reduces security." 14 70; then
|
||||
# ── Option 3: Repair Home Directory Ownership ──
|
||||
_repair_home_ownership() {
|
||||
local home
|
||||
home=$(eval echo "~$USER")
|
||||
home=$(getent passwd "${SUDO_USER:-$USER}" | cut -d: -f6)
|
||||
|
||||
if [ ! -d "$home" ]; then
|
||||
_msg "Home Directory" "Home directory '$home' does not exist." 8 60
|
||||
|
||||
+11
-11
@@ -37,7 +37,7 @@ _show_sysinfo() {
|
||||
msg+="GPU ${gpu_count}: ${desc}\n"
|
||||
msg+=" Driver: ${mesa_ver:+Mesa }${mesa_ver:-unknown}\n"
|
||||
fi
|
||||
done < <(timeout 2 lspci -nn | grep -E "VGA|3D" || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D" || true)
|
||||
fi
|
||||
|
||||
if ! $found_gpu; then
|
||||
@@ -52,13 +52,13 @@ _show_sysinfo() {
|
||||
declare -a pci_eth_lines=()
|
||||
while IFS= read -r line; do
|
||||
pci_eth_lines+=("$line")
|
||||
done < <(timeout 2 lspci -d ::0200 2>/dev/null || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -i 'ethernet controller' || true)
|
||||
|
||||
# ── 2. Detect ALL WiFi chipsets (class 0x0280 + vendor fallbacks) ──
|
||||
declare -a pci_wifi_lines=()
|
||||
while IFS= read -r line; do
|
||||
pci_wifi_lines+=("$line")
|
||||
done < <(timeout 2 lspci -d ::0280 2>/dev/null || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" | grep -i 'network controller' || true)
|
||||
|
||||
# Broadcom vendor-ID fallback (14e4) — include only if not already captured
|
||||
while IFS= read -r line; do
|
||||
@@ -69,7 +69,7 @@ _show_sysinfo() {
|
||||
done
|
||||
! $already && pci_wifi_lines+=("$line")
|
||||
fi
|
||||
done < <(timeout 2 lspci -nn 2>/dev/null || true)
|
||||
done < <(echo "$LSPCI_OUTPUT" || true)
|
||||
|
||||
# USB WiFi fallback
|
||||
local usb_wifi_lines=()
|
||||
@@ -111,7 +111,7 @@ _show_sysinfo() {
|
||||
state=$(echo "$line" | awk '{print $9}')
|
||||
|
||||
case "$iface" in
|
||||
lo|docker*|veth*|br-*|virbr*|tun*|tap*|bond*) continue ;;
|
||||
lo | docker* | veth* | br-* | virbr* | tun* | tap* | bond*) continue ;;
|
||||
esac
|
||||
|
||||
ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}')
|
||||
@@ -138,7 +138,7 @@ _show_sysinfo() {
|
||||
*)
|
||||
# Fallback: classify by interface name pattern
|
||||
case "$iface" in
|
||||
wl*|wlp*|wlo*|wlan*)
|
||||
wl* | wlp* | wlo* | wlan*)
|
||||
has_wifi=true
|
||||
desc="${wifi_descs[$wifi_idx]:-Unknown WiFi chipset}"
|
||||
shown_wifi_descs+=("${wifi_descs[$wifi_idx]:-$desc}")
|
||||
@@ -146,7 +146,7 @@ _show_sysinfo() {
|
||||
ssid=""
|
||||
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
|
||||
;;
|
||||
eth*|enp*|ens*|enx*|eno*)
|
||||
eth* | enp* | ens* | enx* | eno*)
|
||||
has_eth=true
|
||||
desc="${eth_descs[$eth_idx]:-Unknown Ethernet chipset}"
|
||||
shown_eth_descs+=("${eth_descs[$eth_idx]:-$desc}")
|
||||
@@ -214,7 +214,7 @@ _show_sysinfo() {
|
||||
term_cols=$(tput cols 2>/dev/null || echo 80)
|
||||
[ "$term_cols" -lt 50 ] && term_cols=50
|
||||
|
||||
local max_pct=$(( term_cols * 95 / 100 ))
|
||||
local max_pct=$((term_cols * 95 / 100))
|
||||
[ "$max_pct" -lt 50 ] && max_pct=50
|
||||
|
||||
local longest=0
|
||||
@@ -223,7 +223,7 @@ _show_sysinfo() {
|
||||
[ "$len" -gt "$longest" ] && longest=$len
|
||||
done < <(echo -e "$msg")
|
||||
|
||||
local width=$(( longest + 6 ))
|
||||
local width=$((longest + 6))
|
||||
[ "$width" -lt 80 ] && width=80
|
||||
[ "$width" -gt "$max_pct" ] && width=$max_pct
|
||||
|
||||
@@ -238,8 +238,8 @@ _show_sysinfo() {
|
||||
|
||||
local lines
|
||||
lines=$(echo -e "$truncated" | wc -l)
|
||||
local height=$(( lines + 6 ))
|
||||
local max_height=$(( ${LINES:-24} - 4 > 10 ? ${LINES:-24} - 4 : 10 ))
|
||||
local height=$((lines + 6))
|
||||
local max_height=$((${LINES:-24} - 4 > 10 ? ${LINES:-24} - 4 : 10))
|
||||
[ "$height" -gt "$max_height" ] && height=$max_height
|
||||
[ "$height" -lt 10 ] && height=10
|
||||
|
||||
|
||||
+69
-23
@@ -22,6 +22,12 @@ WIFI_CHIPSET=""
|
||||
DESKTOP_ENV=""
|
||||
AUDIO_SERVER=""
|
||||
|
||||
# APT update deduplication flag (set to 1 after the first successful apt-get update)
|
||||
APT_UPDATED=0
|
||||
|
||||
# Cached output of `lspci -nn` for the whole session (populated once via _init_lspci_cache)
|
||||
LSPCI_OUTPUT=""
|
||||
|
||||
# --------------------------
|
||||
# Pre-flight checks
|
||||
# --------------------------
|
||||
@@ -109,7 +115,7 @@ _ensure_time_synced() {
|
||||
if [ -n "${DISPLAY:-}" ] || [ -n "${SSH_TTY:-}" ]; then
|
||||
_msg "Timezone" \
|
||||
"Your system timezone is not set or is set to UTC.\n\nThe script will now open the timezone\nconfiguration tool to set your local timezone." 12 60
|
||||
sudo env LC_ALL=C LANGUAGE=C dpkg-reconfigure tzdata || true
|
||||
sudo env LC_ALL=C LANGUAGE=C dpkg-reconfigure tzdata || true
|
||||
echo -e "${GREEN}Timezone configured: $(timedatectl show -p Timezone --value 2>/dev/null)${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}Timezone not set. Run 'sudo dpkg-reconfigure tzdata' later.${NC}"
|
||||
@@ -136,7 +142,7 @@ sudo env LC_ALL=C LANGUAGE=C dpkg-reconfigure tzdata || true
|
||||
# Debian version detection
|
||||
# --------------------------------
|
||||
detect_debian_version() {
|
||||
if ! command -v lsb_release &> /dev/null; then
|
||||
if ! command -v lsb_release &>/dev/null; then
|
||||
if [ -f /etc/os-release ]; then
|
||||
DEBIAN_CODENAME=$(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release 2>/dev/null || echo "")
|
||||
fi
|
||||
@@ -225,12 +231,23 @@ detect_kernel() {
|
||||
KERNEL_VERSION=$(uname -r)
|
||||
}
|
||||
|
||||
# ----------------------------------
|
||||
# lspci output cache
|
||||
# ----------------------------------
|
||||
# Populates LSPCI_OUTPUT once per session. `lspci -nn` includes the textual PCI
|
||||
# class (VGA/3D/Ethernet/Network/Bluetooth controller) and the device IDs
|
||||
# (e.g. 14e4:), so a single capture covers every grep used across modules.
|
||||
_init_lspci_cache() {
|
||||
[ -n "${LSPCI_OUTPUT:-}" ] && return
|
||||
LSPCI_OUTPUT=$(timeout 2 lspci -nn 2>/dev/null || true)
|
||||
}
|
||||
|
||||
# ----------------------------------
|
||||
# GPU detection
|
||||
# ----------------------------------
|
||||
detect_gpu() {
|
||||
local gpu_lines
|
||||
gpu_lines=$(timeout 2 lspci -nn | grep -E "VGA|3D") || true
|
||||
gpu_lines=$(echo "$LSPCI_OUTPUT" | grep -E "VGA|3D") || true
|
||||
if [ -z "$gpu_lines" ]; then
|
||||
GPU_TYPE="unknown"
|
||||
GPU_DESC="No GPU detected"
|
||||
@@ -257,7 +274,7 @@ detect_gpu() {
|
||||
has_intel=true
|
||||
[ -z "$intel_dev_id" ] && intel_dev_id=$(echo "$line" | grep -oP '8086:\K[0-9a-fA-F]+' | head -n1)
|
||||
fi
|
||||
done <<< "$gpu_lines"
|
||||
done <<<"$gpu_lines"
|
||||
|
||||
GPU_DESC="$desc_lines"
|
||||
HAS_NVIDIA=$has_nvidia
|
||||
@@ -322,21 +339,21 @@ declare -a WIFI_SSIDS=()
|
||||
|
||||
detect_network() {
|
||||
local eth_line
|
||||
eth_line=$(timeout 2 lspci -nn | grep -i 'Ethernet controller' | head -n1) || true
|
||||
eth_line=$(echo "$LSPCI_OUTPUT" | grep -i 'Ethernet controller' | head -n1) || true
|
||||
if [ -n "$eth_line" ]; then
|
||||
ETH_DESC=$(echo "$eth_line" | sed -E 's/^.*\]: //; s/ \[[0-9a-fA-F]{4}:[0-9a-fA-F]{4}\]//; s/ \(rev [0-9a-fA-F]+\)//')
|
||||
fi
|
||||
|
||||
local wifi_line
|
||||
# Layer 1: grep by PCI class description text
|
||||
wifi_line=$(timeout 2 lspci -nn 2>/dev/null | grep -iE 'network controller|wireless|wi-fi|wlan|802\.11' | head -n1) || true
|
||||
wifi_line=$(echo "$LSPCI_OUTPUT" | grep -iE 'network controller|wireless|wi-fi|wlan|802\.11' | head -n1) || true
|
||||
# Layer 2: grep by exact PCI class code 0x0280 (Network controller)
|
||||
if [ -z "$wifi_line" ]; then
|
||||
wifi_line=$(timeout 2 lspci -d ::0280 2>/dev/null | head -n1) || true
|
||||
wifi_line=$(echo "$LSPCI_OUTPUT" | grep -i 'network controller' | head -n1) || true
|
||||
fi
|
||||
# Layer 3: Broadcom vendor ID fallback (14e4)
|
||||
if [ -z "$wifi_line" ]; then
|
||||
wifi_line=$(timeout 2 lspci -nn 2>/dev/null | grep -i '14e4:' | head -n1) || true
|
||||
wifi_line=$(echo "$LSPCI_OUTPUT" | grep -i '14e4:' | head -n1) || true
|
||||
fi
|
||||
if [ -n "$wifi_line" ]; then
|
||||
WIFI_CHIPSET="$wifi_line"
|
||||
@@ -363,14 +380,14 @@ detect_network() {
|
||||
iface=$(echo "$line" | awk -F': ' '{print $2}' | sed 's/@.*//')
|
||||
state=$(echo "$line" | awk '{print $9}')
|
||||
case "$iface" in
|
||||
eth*|enp*|ens*|enx*|eno*)
|
||||
eth* | enp* | ens* | enx* | eno*)
|
||||
ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}')
|
||||
ETH_NAMES+=("$iface")
|
||||
ETH_STATES+=("$state")
|
||||
ETH_IPS+=("${ip4:-}")
|
||||
ETH_DESCS+=("${ETH_DESC:-}")
|
||||
;;
|
||||
wl*|wlp*|wlo*|wlan*)
|
||||
wl* | wlp* | wlo* | wlan*)
|
||||
ip4=$(timeout 2 ip -4 -o addr show "$iface" 2>/dev/null | awk '{print $4}')
|
||||
ssid=""
|
||||
[ "$state" = "UP" ] && ssid=$(timeout 2 iwgetid -r "$iface" 2>/dev/null || true)
|
||||
@@ -498,37 +515,42 @@ get_intel_generation() {
|
||||
# ----------------------------------------------------------------------
|
||||
is_backports_enabled() {
|
||||
local codename="${DEBIAN_CODENAME:-}"
|
||||
[ -z "$codename" ] && { echo false; return; }
|
||||
[ -z "$codename" ] && {
|
||||
echo false
|
||||
return
|
||||
}
|
||||
|
||||
local c_pattern="^[^#]*${codename}-backports[[:space:]]+"
|
||||
local d_pattern="Suites:.*${codename}-backports"
|
||||
|
||||
# Classic embedded (sources.list)
|
||||
if [ -f /etc/apt/sources.list ] && grep -Eq "$c_pattern" /etc/apt/sources.list 2>/dev/null; then
|
||||
echo true; return
|
||||
echo true
|
||||
return
|
||||
fi
|
||||
|
||||
# Classic standalone (any .list file in sources.list.d)
|
||||
if [ -d /etc/apt/sources.list.d ] && grep -qrE "$c_pattern" /etc/apt/sources.list.d/*.list 2>/dev/null; then
|
||||
echo true; return
|
||||
echo true
|
||||
return
|
||||
fi
|
||||
|
||||
# Deb822 any .sources file
|
||||
if [ -d /etc/apt/sources.list.d ] && grep -qr "$d_pattern" /etc/apt/sources.list.d/*.sources 2>/dev/null; then
|
||||
echo true; return
|
||||
echo true
|
||||
return
|
||||
fi
|
||||
|
||||
echo false
|
||||
}
|
||||
|
||||
|
||||
install_backports_or_stable() {
|
||||
local pkg="$1"
|
||||
local pkg_desc="${2:-$pkg}"
|
||||
|
||||
local bpo_ver=""
|
||||
if [ "$(is_backports_enabled)" == true ]; then
|
||||
bpo_ver=$(apt-cache madison "$pkg" 2>/dev/null | \
|
||||
bpo_ver=$(apt-cache madison "$pkg" 2>/dev/null |
|
||||
grep "${DEBIAN_CODENAME}-backports" | awk '{print $3}' | head -1)
|
||||
fi
|
||||
|
||||
@@ -594,17 +616,20 @@ _msg_red() {
|
||||
}
|
||||
|
||||
_menu() {
|
||||
local title="$1" text="$2" h="$3" w="$4" lh="$5"; shift 5
|
||||
local title="$1" text="$2" h="$3" w="$4" lh="$5"
|
||||
shift 5
|
||||
whiptail --title "$title" --menu "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true
|
||||
}
|
||||
|
||||
_checklist() {
|
||||
local title="$1" text="$2" h="$3" w="$4" lh="$5"; shift 5
|
||||
local title="$1" text="$2" h="$3" w="$4" lh="$5"
|
||||
shift 5
|
||||
whiptail --title "$title" --ok-button "Apply" --checklist "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true
|
||||
}
|
||||
|
||||
_radiolist() {
|
||||
local title="$1" text="$2" h="$3" w="$4" lh="$5"; shift 5
|
||||
local title="$1" text="$2" h="$3" w="$4" lh="$5"
|
||||
shift 5
|
||||
whiptail --title "$title" --ok-button "Install" --radiolist "$text" "$h" "$w" "$lh" "$@" 3>&1 1>&2 2>&3 || true
|
||||
}
|
||||
|
||||
@@ -616,7 +641,7 @@ _validate_sudoers() {
|
||||
local content="$1" dest="$2"
|
||||
local tmpfile
|
||||
tmpfile=$(mktemp) || return 1
|
||||
echo "$content" > "$tmpfile"
|
||||
echo "$content" >"$tmpfile"
|
||||
if ! /usr/sbin/visudo -cf "$tmpfile" &>/dev/null; then
|
||||
local err
|
||||
err=$(/usr/sbin/visudo -cf "$tmpfile" 2>&1 || true)
|
||||
@@ -701,7 +726,7 @@ _run_install_pkg() {
|
||||
|
||||
get_backports_kernel_version() {
|
||||
local ver
|
||||
ver=$(apt-cache policy linux-image-amd64 2>/dev/null | \
|
||||
ver=$(apt-cache policy linux-image-amd64 2>/dev/null |
|
||||
grep -E '^[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+.*~bpo' | head -n1 | awk '{print $1}')
|
||||
if [ -n "$ver" ]; then
|
||||
echo "$ver"
|
||||
@@ -759,10 +784,29 @@ _check_network() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# ----------------------------------
|
||||
# APT update deduplication
|
||||
# ----------------------------------
|
||||
# Runs `apt-get update` at most once per session. Subsequent calls bypass the
|
||||
# network refresh. Returns 0 on success, 1 if apt-get update fails.
|
||||
_ensure_apt_updated() {
|
||||
if [ "$APT_UPDATED" -eq 1 ]; then
|
||||
echo -e "${GREEN}[+]${NC} APT package lists already refreshed this session."
|
||||
return 0
|
||||
fi
|
||||
echo -e "${GREEN}[+]${NC} Refreshing APT package lists..."
|
||||
if sudo apt-get update; then
|
||||
APT_UPDATED=1
|
||||
return 0
|
||||
fi
|
||||
echo -e "${RED}[-]${NC} apt-get update failed."
|
||||
return 1
|
||||
}
|
||||
|
||||
# ----------------------------------
|
||||
# LightDM configuration
|
||||
# ----------------------------------
|
||||
_configure_lightdm() {
|
||||
_configure_lightdm() {
|
||||
command -v lightdm &>/dev/null || return 0
|
||||
|
||||
if _confirm "LightDM" "Configure LightDM to show the user list on the login screen?\n\nThis disables greeter-hide-users."; then
|
||||
@@ -782,7 +826,7 @@ _check_network() {
|
||||
fi
|
||||
|
||||
sudo mkdir -p "$conf_dir"
|
||||
printf '[Seat:*]\ngreeter-hide-users=false\n' | sudo tee "$conf_file" > /dev/null
|
||||
printf '[Seat:*]\ngreeter-hide-users=false\n' | sudo tee "$conf_file" >/dev/null
|
||||
echo -e "${GREEN}LightDM configured to show user list.${NC}"
|
||||
fi
|
||||
}
|
||||
@@ -792,4 +836,6 @@ refresh_system_state() {
|
||||
detect_debian_version
|
||||
detect_gpu
|
||||
detect_cpu_ram
|
||||
detect_network
|
||||
detect_desktop_environment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user