mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-07-16 05:49:49 +00:00
Add files via upload
This commit is contained in:
+24
-10
@@ -32,6 +32,9 @@ fi
|
|||||||
if [ -f "${MODULES_DIR}/extras.sh" ]; then
|
if [ -f "${MODULES_DIR}/extras.sh" ]; then
|
||||||
source "${MODULES_DIR}/extras.sh"
|
source "${MODULES_DIR}/extras.sh"
|
||||||
fi
|
fi
|
||||||
|
if [ -f "${MODULES_DIR}/zram.sh" ]; then
|
||||||
|
source "${MODULES_DIR}/zram.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
# --------------------------
|
# --------------------------
|
||||||
# Global state
|
# Global state
|
||||||
@@ -40,6 +43,14 @@ REPOS_CONFIGURED=false
|
|||||||
DEBIAN_VERSION=""
|
DEBIAN_VERSION=""
|
||||||
DEBIAN_CODENAME=""
|
DEBIAN_CODENAME=""
|
||||||
|
|
||||||
|
# ---------------------------------
|
||||||
|
# Pause helper
|
||||||
|
# ---------------------------------
|
||||||
|
pause() {
|
||||||
|
echo ""
|
||||||
|
read -p "Press Enter to continue..."
|
||||||
|
}
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
# menu
|
# menu
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
@@ -51,14 +62,15 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
main_menu() {
|
main_menu() {
|
||||||
PS3="Select an option (1-8): "
|
PS3="Select an option (1-9): "
|
||||||
options=(
|
options=(
|
||||||
"User Privileges & Feedback"
|
"User Privileges & Feedback"
|
||||||
"Configure repositories"
|
"Configure repositories"
|
||||||
"Setup Wireless & Firmware"
|
"Setup Wireless & Firmware"
|
||||||
"Configure Graphics Stack and Tools"
|
"Configure Graphics Stack and Tools"
|
||||||
"Update Kernel to Backports"
|
"Update Kernel to Backports"
|
||||||
"Gaming Setup"
|
"Gaming Setup and Performance"
|
||||||
|
"Install ZRAM (compressed swap)"
|
||||||
"Install extra applications"
|
"Install extra applications"
|
||||||
"Exit"
|
"Exit"
|
||||||
)
|
)
|
||||||
@@ -95,16 +107,18 @@ main_menu() {
|
|||||||
|
|
||||||
select opt in "${options[@]}"; do
|
select opt in "${options[@]}"; do
|
||||||
case $REPLY in
|
case $REPLY in
|
||||||
1) config_sudo ;;
|
1) config_sudo || true ;;
|
||||||
2) configure_repos ;;
|
2) configure_repos || true ;;
|
||||||
3) install_firmware ;;
|
3) install_firmware || true ;;
|
||||||
4) install_gpu_drivers ;;
|
4) install_gpu_drivers || true ;;
|
||||||
5) install_kernel_backports ;;
|
5) install_kernel_backports || true ;;
|
||||||
6) install_gaming ;;
|
6) install_gaming || true ;;
|
||||||
7) install_extras ;;
|
7) install_zram || true ;;
|
||||||
8) echo "Exiting."; exit 0 ;;
|
8) install_extras || true ;;
|
||||||
|
9) echo "Exiting."; exit 0 ;;
|
||||||
*) echo "Invalid choice. Please try again." ;;
|
*) echo "Invalid choice. Please try again." ;;
|
||||||
esac
|
esac
|
||||||
|
[ "$REPLY" != "9" ] && [ "$REPLY" != "" ] && pause
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
+195
-86
@@ -11,27 +11,125 @@ install_extras() {
|
|||||||
fetch_pkg="fastfetch"
|
fetch_pkg="fastfetch"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
! command -v dialog &>/dev/null && sudo apt install -y dialog 2>/dev/null || true
|
||||||
|
|
||||||
|
# Quick Install prompt
|
||||||
|
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
|
||||||
|
|
||||||
|
# Helper: mark installed packages
|
||||||
|
mk_inst() {
|
||||||
|
if is_installed "$1"; then
|
||||||
|
echo " (installed)"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Dynamic states for all packages (keeps installed ones pre-marked)
|
||||||
|
local compress_state="OFF"
|
||||||
|
is_installed "zip" && is_installed "unzip" && is_installed "p7zip-full" && compress_state="ON"
|
||||||
|
|
||||||
|
local fetch_state="OFF"; is_installed "$fetch_pkg" && fetch_state="ON"
|
||||||
|
local lshw_state="OFF"; is_installed "lshw" && lshw_state="ON"
|
||||||
|
local inxi_state="OFF"; is_installed "inxi" && inxi_state="ON"
|
||||||
|
local hardinfo_state="OFF"; is_installed "hardinfo" && hardinfo_state="ON"
|
||||||
|
local cpufetch_state="OFF"; is_installed "cpufetch" && cpufetch_state="ON"
|
||||||
|
local cpu_x_state="OFF"; is_installed "cpu-x" && cpu_x_state="ON"
|
||||||
|
local btop_state="OFF"; is_installed "btop" && btop_state="ON"
|
||||||
|
local htop_state="OFF"; is_installed "htop" && htop_state="ON"
|
||||||
|
local vlc_state="OFF"; is_installed "vlc" && vlc_state="ON"
|
||||||
|
local mpv_state="OFF"; is_installed "mpv" && mpv_state="ON"
|
||||||
|
local chromium_state="OFF"; is_installed "chromium" && chromium_state="ON"
|
||||||
|
local ttf_state="OFF"; is_installed "ttf-mscorefonts-installer" && ttf_state="ON"
|
||||||
|
local fonts_state="OFF"; is_installed "fonts-ubuntu" && fonts_state="ON"
|
||||||
|
local gparted_state="OFF"; is_installed "gparted" && gparted_state="ON"
|
||||||
|
local flatpak_state="OFF"; is_installed "flatpak" && flatpak_state="ON"
|
||||||
|
local fwupd_state="OFF"; is_installed "fwupd" && fwupd_state="ON"
|
||||||
|
local nala_state="OFF"; is_installed "nala" && nala_state="ON"
|
||||||
|
local ssh_state="OFF"; is_installed "openssh-server" && ssh_state="ON"
|
||||||
|
local timeshift_state="OFF"; is_installed "timeshift" && timeshift_state="ON"
|
||||||
|
local kitty_state="OFF"; is_installed "kitty" && kitty_state="ON"
|
||||||
|
local alacritty_state="OFF"; is_installed "alacritty" && alacritty_state="ON"
|
||||||
|
local psensor_state="OFF"; is_installed "psensor" && psensor_state="ON"
|
||||||
|
local mc_state="OFF"; is_installed "mc" && mc_state="ON"
|
||||||
|
local disks_state="OFF"; is_installed "gnome-disk-utility" && disks_state="ON"
|
||||||
|
local build_state="OFF"; is_installed "build-essential" && build_state="ON"
|
||||||
|
local props_state="OFF"; is_installed "software-properties-common" && props_state="ON"
|
||||||
|
local thunderbird_state="OFF"; is_installed "thunderbird" && thunderbird_state="ON"
|
||||||
|
local curl_wget_state="OFF"; is_installed "curl" && is_installed "wget" && curl_wget_state="ON"
|
||||||
|
local extrepo_state="OFF"; is_installed "extrepo" && extrepo_state="ON"
|
||||||
|
local conky_state="OFF"; is_installed "conky" && conky_state="ON"
|
||||||
|
|
||||||
|
local firefox_state="OFF"
|
||||||
|
if command -v firefox &>/dev/null && ! command -v firefox-esr &>/dev/null; then
|
||||||
|
firefox_state="ON"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local kvm_state="OFF"; is_installed "virt-manager" && kvm_state="ON"
|
||||||
|
local librewolf_state="OFF"; is_installed "librewolf" && librewolf_state="ON"
|
||||||
|
|
||||||
local choices
|
local choices
|
||||||
choices=$(whiptail --title "Extra Software" --checklist \
|
choices=$(dialog --title "Extra Software" --checklist \
|
||||||
"Select programs to install (space to toggle, enter to confirm):" \
|
"Select programs to install (space to toggle, enter to confirm):" \
|
||||||
22 75 15 \
|
26 72 23 \
|
||||||
"lshw" "List hardware details" ON \
|
"alacritty" "GPU-accelerated terminal$(mk_inst alacritty)" "$alacritty_state" \
|
||||||
"inxi" "System information tool" ON \
|
"btop" "Resource monitor (fancy top)$(mk_inst btop)" "$btop_state" \
|
||||||
"hardinfo" "Graphical system profiler" OFF \
|
"build-essential" "C/C++ build tools (gcc, make)$(mk_inst build-essential)" "$build_state" \
|
||||||
"fetch" "System info (${fetch_pkg})" ON \
|
"chromium" "Chromium web browser$(mk_inst chromium)" "$chromium_state" \
|
||||||
"cpufetch" "CPU info fetcher" ON \
|
"compress" "Compression tools (zip, unrar, 7z)$(mk_inst zip)" "$compress_state" \
|
||||||
"cpu-x" "CPU-X (GUI alternative to CPU-Z)" ON \
|
"conky" "System monitor for desktop$(mk_inst conky)" "$conky_state" \
|
||||||
"btop" "Resource monitor (fancy top)" OFF \
|
"cpufetch" "CPU info fetcher$(mk_inst cpufetch)" "$cpufetch_state" \
|
||||||
"htop" "Interactive process viewer" ON \
|
"cpu-x" "CPU-X (alternative to CPU-Z)$(mk_inst cpu-x)" "$cpu_x_state" \
|
||||||
"vlc" "VLC media player" ON \
|
"curl-wget" "HTTP transfer tools (curl, wget)$(mk_inst curl)" "$curl_wget_state" \
|
||||||
"mpv" "Lightweight media player" OFF \
|
"extrepo" "External repository manager$(mk_inst extrepo)" "$extrepo_state" \
|
||||||
"chromium" "Chromium web browser" OFF \
|
"${fetch_pkg}" "Show system info$(mk_inst $fetch_pkg)" "$fetch_state" \
|
||||||
"ttf-mscorefonts-installer" "Microsoft TrueType fonts" ON \
|
"firefox" "Firefox from Mozilla (replaces ESR)" "$firefox_state" \
|
||||||
"fonts-ubuntu" "Ubuntu font family" OFF \
|
"flatpak" "Flatpak sandbox + Flathub$(mk_inst flatpak)" "$flatpak_state" \
|
||||||
"gparted" "GNOME partition editor" OFF \
|
"fonts-ubuntu" "Ubuntu font family$(mk_inst fonts-ubuntu)" "$fonts_state" \
|
||||||
"flatpak" "Flatpak application sandbox" OFF \
|
"fwupd" "Firmware update daemon$(mk_inst fwupd)" "$fwupd_state" \
|
||||||
"firefox" "Firefox from Mozilla (replaces ESR)" OFF \
|
"gnome-disk-utility" "Disk management GUI$(mk_inst gnome-disk-utility)" "$disks_state" \
|
||||||
|
"gparted" "GNOME partition editor$(mk_inst gparted)" "$gparted_state" \
|
||||||
|
"hardinfo" "Graphical system profiler$(mk_inst hardinfo)" "$hardinfo_state" \
|
||||||
|
"htop" "Interactive process viewer$(mk_inst htop)" "$htop_state" \
|
||||||
|
"inxi" "System information tool$(mk_inst inxi)" "$inxi_state" \
|
||||||
|
"kitty" "GPU-based terminal emulator$(mk_inst kitty)" "$kitty_state" \
|
||||||
|
"kvm" "QEMU/KVM virtualization$(mk_inst virt-manager)" "$kvm_state" \
|
||||||
|
"librewolf" "Privacy-focused Firefox fork$(mk_inst librewolf)" "$librewolf_state" \
|
||||||
|
"lshw" "List hardware details$(mk_inst lshw)" "$lshw_state" \
|
||||||
|
"mc" "Midnight Commander (file manager)$(mk_inst mc)" "$mc_state" \
|
||||||
|
"mpv" "Lightweight media player$(mk_inst mpv)" "$mpv_state" \
|
||||||
|
"nala" "APT frontend with parallel downloads$(mk_inst nala)" "$nala_state" \
|
||||||
|
"openssh-server" "SSH server$(mk_inst openssh-server)" "$ssh_state" \
|
||||||
|
"psensor" "Hardware temperature monitor$(mk_inst psensor)" "$psensor_state" \
|
||||||
|
"software-properties-common" "Repository management (PPA)$(mk_inst software-properties-common)" "$props_state" \
|
||||||
|
"thunderbird" "Email client$(mk_inst thunderbird)" "$thunderbird_state" \
|
||||||
|
"timeshift" "System restore snapshots$(mk_inst timeshift)" "$timeshift_state" \
|
||||||
|
"ttf-mscorefonts-installer" "Microsoft fonts (Times, Arial)$(mk_inst ttf-mscorefonts-installer)" "$ttf_state" \
|
||||||
|
"vlc" "VLC media player$(mk_inst vlc)" "$vlc_state" \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
|
clear
|
||||||
|
|
||||||
if [ -z "$choices" ]; then
|
if [ -z "$choices" ]; then
|
||||||
echo "No extra programs selected."
|
echo "No extra programs selected."
|
||||||
@@ -43,82 +141,93 @@ install_extras() {
|
|||||||
|
|
||||||
for pkg in $cleaned; do
|
for pkg in $cleaned; do
|
||||||
case $pkg in
|
case $pkg in
|
||||||
fetch)
|
compress)
|
||||||
sudo apt install -y "$fetch_pkg"
|
local need=()
|
||||||
|
! is_installed "zip" && need+=("zip")
|
||||||
|
! is_installed "unzip" && need+=("unzip")
|
||||||
|
! is_installed "rar" && need+=("rar")
|
||||||
|
! is_installed "unrar" && need+=("unrar")
|
||||||
|
! is_installed "p7zip-full" && need+=("p7zip-full")
|
||||||
|
! is_installed "p7zip-rar" && need+=("p7zip-rar")
|
||||||
|
if [ ${#need[@]} -gt 0 ]; then
|
||||||
|
echo "Installing compression utilities..."
|
||||||
|
sudo apt install -y "${need[@]}"
|
||||||
|
echo -e "${GREEN}Compression utilities installed.${NC}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
curl-wget)
|
||||||
|
local need_cw=()
|
||||||
|
! is_installed "curl" && need_cw+=("curl")
|
||||||
|
! is_installed "wget" && need_cw+=("wget")
|
||||||
|
if [ ${#need_cw[@]} -gt 0 ]; then
|
||||||
|
echo "Installing HTTP transfer tools..."
|
||||||
|
sudo apt install -y "${need_cw[@]}"
|
||||||
|
else
|
||||||
|
echo "curl and wget already installed."
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
firefox)
|
firefox)
|
||||||
install_firefox_mozilla
|
install_firefox_mozilla
|
||||||
;;
|
;;
|
||||||
*)
|
flatpak)
|
||||||
|
if ! is_installed "flatpak"; then
|
||||||
|
echo "Installing Flatpak..."
|
||||||
|
sudo apt install -y flatpak
|
||||||
|
if command -v plasma-discover &>/dev/null; then
|
||||||
|
sudo apt install -y plasma-discover-backend-flatpak
|
||||||
|
echo "Flatpak backend for Discover installed."
|
||||||
|
elif command -v gnome-software &>/dev/null; then
|
||||||
|
sudo apt install -y gnome-software-plugin-flatpak
|
||||||
|
echo "Flatpak plugin for GNOME Software installed."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Flatpak already installed."
|
||||||
|
fi
|
||||||
|
flatpak remote-add --if-not-exists flathub \
|
||||||
|
https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
echo "Flathub repository added."
|
||||||
|
echo -e "${GREEN}A reboot is recommended.${NC}"
|
||||||
|
;;
|
||||||
|
kvm)
|
||||||
|
if ! is_installed "virt-manager"; then
|
||||||
|
echo "Installing QEMU/KVM virtualization..."
|
||||||
|
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" kvm 2>/dev/null || true
|
||||||
|
echo -e "${GREEN}QEMU/KVM installed. A reboot is recommended.${NC}"
|
||||||
|
else
|
||||||
|
echo "QEMU/KVM already installed."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
librewolf)
|
||||||
|
if ! is_installed "librewolf"; then
|
||||||
|
echo "Installing LibreWolf..."
|
||||||
|
sudo apt install -y extrepo
|
||||||
|
sudo extrepo enable librewolf 2>/dev/null || true
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y librewolf
|
||||||
|
echo -e "${GREEN}LibreWolf installed.${NC}"
|
||||||
|
else
|
||||||
|
echo "LibreWolf already installed."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
neofetch|fastfetch)
|
||||||
|
if ! is_installed "$pkg"; then
|
||||||
sudo apt install -y "$pkg"
|
sudo apt install -y "$pkg"
|
||||||
|
else
|
||||||
|
echo "$pkg already installed."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if ! is_installed "$pkg"; then
|
||||||
|
sudo apt install -y "$pkg"
|
||||||
|
else
|
||||||
|
echo "$pkg already installed."
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "${GREEN}Extra software installed.${NC}"
|
echo -e "${GREEN}Extra software installed.${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------
|
|
||||||
# Firefox from Mozilla official APT repository
|
|
||||||
# ---------------------------------------------
|
|
||||||
install_firefox_mozilla() {
|
|
||||||
echo -e "${YELLOW}Installing Firefox from Mozilla...${NC}"
|
|
||||||
|
|
||||||
sudo apt install -y wget gpg
|
|
||||||
|
|
||||||
sudo install -d -m 0755 /etc/apt/keyrings
|
|
||||||
|
|
||||||
if [ ! -f /etc/apt/keyrings/packages.mozilla.org.asc ]; then
|
|
||||||
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | \
|
|
||||||
sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
|
|
||||||
echo "Mozilla signing key imported."
|
|
||||||
else
|
|
||||||
echo "Mozilla key already present."
|
|
||||||
fi
|
|
||||||
|
|
||||||
local fingerprint
|
|
||||||
fingerprint=$(gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc 2>/dev/null | \
|
|
||||||
awk '/pub/ { getline; gsub(/^ +| +$/, ""); print }')
|
|
||||||
if [ "$fingerprint" != "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3" ]; then
|
|
||||||
echo -e "${RED}Warning: Mozilla signing key fingerprint mismatch!${NC}"
|
|
||||||
echo "Expected: 35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3"
|
|
||||||
echo "Got: $fingerprint"
|
|
||||||
echo "Aborting Firefox installation for security."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$DEBIAN_CODENAME" = "bookworm" ]; then
|
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | \
|
|
||||||
sudo tee /etc/apt/sources.list.d/mozilla.list > /dev/null
|
|
||||||
else
|
|
||||||
sudo tee /etc/apt/sources.list.d/mozilla.sources > /dev/null <<EOF
|
|
||||||
Types: deb
|
|
||||||
URIs: https://packages.mozilla.org/apt
|
|
||||||
Suites: mozilla
|
|
||||||
Components: main
|
|
||||||
Signed-By: /etc/apt/keyrings/packages.mozilla.org.asc
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
sudo tee /etc/apt/preferences.d/mozilla > /dev/null <<EOF
|
|
||||||
Package: *
|
|
||||||
Pin: origin packages.mozilla.org
|
|
||||||
Pin-Priority: 1000
|
|
||||||
EOF
|
|
||||||
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y firefox
|
|
||||||
|
|
||||||
echo -e "${GREEN}Firefox from Mozilla installed.${NC}"
|
|
||||||
|
|
||||||
if dpkg -l firefox-esr &> /dev/null; then
|
|
||||||
if whiptail --title "Remove Firefox ESR" \
|
|
||||||
--yesno "Firefox ESR is still installed. Do you want to remove it?" 8 60; then
|
|
||||||
sudo apt remove -y firefox-esr
|
|
||||||
echo "Firefox ESR removed."
|
|
||||||
else
|
|
||||||
echo "Keeping Firefox ESR alongside."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
install_firmware() {
|
install_firmware() {
|
||||||
|
local fw_pkgs
|
||||||
|
fw_pkgs=$(pkg_versions firmware-linux-nonfree)
|
||||||
|
if ! whiptail --title "Base Firmware" --yesno \
|
||||||
|
"Install the following package?\n\n${fw_pkgs}\nProvides firmware for various hardware components.\n\nProceed?" 14 65; then
|
||||||
|
echo "Skipping base firmware."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
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 ]; then
|
if [ "$(is_backports_enabled)" == true ]; then
|
||||||
|
|||||||
+31
-7
@@ -6,12 +6,13 @@ install_gaming() {
|
|||||||
|
|
||||||
local choices
|
local choices
|
||||||
choices=$(whiptail --title "Gaming Setup" --checklist \
|
choices=$(whiptail --title "Gaming Setup" --checklist \
|
||||||
"Select gaming packages to install:" 15 70 5 \
|
"Select gaming packages to install:" 16 72 6 \
|
||||||
"steam" "Steam (official .deb from Valve, requires 32-bit)" ON \
|
"Steam" "Steam (official .deb from Valve, requires 32-bit)" ON \
|
||||||
"gamemode" "Optimise system for gaming" ON \
|
"Gamemode" "Optimise system for gaming" ON \
|
||||||
"mangohud" "Vulkan/OpenGL performance overlay" ON \
|
"Mangohud" "Vulkan/OpenGL performance overlay" ON \
|
||||||
"goverlay" "GUI for configuring MangoHud" OFF \
|
"Heroic" "Heroic Games Launcher (Epic Games, GOG) - .deb" OFF \
|
||||||
"lutris" "Game launcher/runner" OFF \
|
"Goverlay" "GUI for configuring MangoHud" ON \
|
||||||
|
"Lutris" "Game launcher/runner" OFF \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
if [ -z "$choices" ]; then
|
if [ -z "$choices" ]; then
|
||||||
@@ -29,11 +30,17 @@ install_gaming() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(is_backports_enabled)" == true ]; then
|
if [ "$(is_backports_enabled)" == true ]; then
|
||||||
echo "Backports enabled. Installing newer Mesa from backports..."
|
local mesa_pkgs
|
||||||
|
mesa_pkgs=$(pkg_versions libgl1-mesa-dri mesa-vulkan-drivers)
|
||||||
|
if whiptail --title "Backports Mesa" --yesno \
|
||||||
|
"Install newer Mesa (GPU drivers) from backports?\n\n${mesa_pkgs}\nProceed?" 14 65; then
|
||||||
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" libgl1-mesa-dri mesa-vulkan-drivers
|
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" libgl1-mesa-dri mesa-vulkan-drivers
|
||||||
if dpkg --print-foreign-architectures | grep -q i386; then
|
if dpkg --print-foreign-architectures | grep -q i386; then
|
||||||
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" libgl1-mesa-dri:i386 mesa-vulkan-drivers:i386
|
sudo apt install -y -t "${DEBIAN_CODENAME}-backports" libgl1-mesa-dri:i386 mesa-vulkan-drivers:i386
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Skipping Mesa from backports."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for pkg in $cleaned; do
|
for pkg in $cleaned; do
|
||||||
@@ -44,6 +51,23 @@ install_gaming() {
|
|||||||
wget -O "$steam_deb" "https://cdn.fastly.steamstatic.com/client/installer/steam.deb"
|
wget -O "$steam_deb" "https://cdn.fastly.steamstatic.com/client/installer/steam.deb"
|
||||||
sudo apt install -y "$steam_deb"
|
sudo apt install -y "$steam_deb"
|
||||||
;;
|
;;
|
||||||
|
heroic)
|
||||||
|
echo "Downloading Heroic Games Launcher..."
|
||||||
|
sudo apt install -y curl wget 2>/dev/null || true
|
||||||
|
local heroic_deb="/tmp/heroic.deb"
|
||||||
|
local gh_url
|
||||||
|
gh_url=$(curl -s https://api.github.com/repos/Heroic-Games-Launcher/\
|
||||||
|
HeroicGamesLauncher/releases/latest | \
|
||||||
|
grep -oP 'https://[^"]+amd64\.deb' | head -1)
|
||||||
|
if [ -z "$gh_url" ]; then
|
||||||
|
echo -e "${RED}Could not determine latest Heroic release.${NC}"
|
||||||
|
else
|
||||||
|
wget -O "$heroic_deb" "$gh_url"
|
||||||
|
sudo apt install -y "$heroic_deb"
|
||||||
|
rm -f "$heroic_deb"
|
||||||
|
echo -e "${GREEN}Heroic Games Launcher installed.${NC}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
sudo apt install -y "$pkg"
|
sudo apt install -y "$pkg"
|
||||||
;;
|
;;
|
||||||
|
|||||||
+41
-16
@@ -13,11 +13,16 @@ install_gpu_drivers() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo ""
|
local tool_pkgs
|
||||||
echo "Installing nvtop (GPU monitor) and vainfo (VA-API check)..."
|
tool_pkgs=$(pkg_versions nvtop vainfo)
|
||||||
|
if whiptail --title "GPU Tools" --yesno \
|
||||||
|
"Install the following packages?\n\n${tool_pkgs}\nProceed?" 14 65; then
|
||||||
sudo apt install -y nvtop vainfo
|
sudo apt install -y nvtop vainfo
|
||||||
echo ""
|
echo ""
|
||||||
vainfo
|
vainfo
|
||||||
|
else
|
||||||
|
echo "Skipping GPU monitoring tools."
|
||||||
|
fi
|
||||||
echo -e "${GREEN}GPU setup complete.${NC}"
|
echo -e "${GREEN}GPU setup complete.${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,6 +30,13 @@ install_gpu_drivers() {
|
|||||||
# AMD GPU
|
# AMD GPU
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
install_amd() {
|
install_amd() {
|
||||||
|
local pkgs
|
||||||
|
pkgs=$(pkg_versions firmware-amd-graphics radeontop)
|
||||||
|
if ! whiptail --title "AMD GPU" --yesno \
|
||||||
|
"Install the following packages?\n\n${pkgs}\nProceed?" 14 65; then
|
||||||
|
echo "Skipping AMD GPU drivers."
|
||||||
|
return
|
||||||
|
fi
|
||||||
echo -e "${YELLOW}Installing AMD GPU drivers and firmware...${NC}"
|
echo -e "${YELLOW}Installing AMD GPU drivers and firmware...${NC}"
|
||||||
sudo apt install -y firmware-amd-graphics radeontop
|
sudo apt install -y firmware-amd-graphics radeontop
|
||||||
echo -e "${GREEN}AMD drivers installed.${NC}"
|
echo -e "${GREEN}AMD drivers installed.${NC}"
|
||||||
@@ -34,24 +46,31 @@ install_amd() {
|
|||||||
# Intel GPU
|
# Intel GPU
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
install_intel() {
|
install_intel() {
|
||||||
echo -e "${YELLOW}Installing Intel GPU firmware and drivers...${NC}"
|
|
||||||
|
|
||||||
# Base firmware
|
|
||||||
sudo apt install -y firmware-intel-graphics
|
|
||||||
|
|
||||||
# Determine VA-API driver based on generation
|
|
||||||
local gen
|
local gen
|
||||||
gen=$(get_intel_generation)
|
gen=$(get_intel_generation)
|
||||||
echo "Detected Intel GPU generation: $gen"
|
local va_driver
|
||||||
|
|
||||||
if [ "$gen" = "gen7-" ]; then
|
if [ "$gen" = "gen7-" ]; then
|
||||||
echo "Gen 7 or older: installing i965-va-driver-shaders"
|
va_driver="i965-va-driver-shaders"
|
||||||
sudo apt install -y i965-va-driver-shaders
|
|
||||||
else
|
else
|
||||||
echo "Gen 8 or newer: installing intel-media-va-driver-non-free"
|
va_driver="intel-media-va-driver-non-free"
|
||||||
sudo apt install -y intel-media-va-driver-non-free
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local pkgs
|
||||||
|
pkgs=$(pkg_versions firmware-intel-graphics "$va_driver")
|
||||||
|
if ! whiptail --title "Intel GPU" --yesno \
|
||||||
|
"Install the following packages?\n\n${pkgs}\nProceed?" 14 65; then
|
||||||
|
echo "Skipping Intel GPU drivers."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${YELLOW}Installing Intel GPU firmware and drivers...${NC}"
|
||||||
|
|
||||||
|
sudo apt install -y firmware-intel-graphics
|
||||||
|
|
||||||
|
echo "Detected Intel GPU generation: $gen"
|
||||||
|
echo "Installing ${va_driver}..."
|
||||||
|
sudo apt install -y "$va_driver"
|
||||||
|
|
||||||
echo -e "${GREEN}Intel GPU drivers installed.${NC}"
|
echo -e "${GREEN}Intel GPU drivers installed.${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +136,6 @@ install_nvidia() {
|
|||||||
echo "No driver will be installed."
|
echo "No driver will be installed."
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
# On Debian 12, tesla-470 is available; 390/340 are not in any supported Debian release
|
|
||||||
if [[ "$recommended" =~ legacy-390|legacy-340 ]]; then
|
if [[ "$recommended" =~ legacy-390|legacy-340 ]]; then
|
||||||
echo -e "${RED}Your GPU requires $recommended, which is not available.${NC}"
|
echo -e "${RED}Your GPU requires $recommended, which is not available.${NC}"
|
||||||
echo "No driver will be installed."
|
echo "No driver will be installed."
|
||||||
@@ -126,7 +144,14 @@ install_nvidia() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If we reach here, the recommended driver is installable
|
local nv_pkgs
|
||||||
|
nv_pkgs=$(pkg_versions "$recommended" firmware-misc-nonfree nvidia-vaapi-driver)
|
||||||
|
if ! whiptail --title "NVIDIA Driver" --yesno \
|
||||||
|
"Install the following packages?\n\n${nv_pkgs}\nA reboot will be required.\n\nProceed?" 14 65; then
|
||||||
|
echo "Skipping NVIDIA driver installation."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
sudo apt install -y "$recommended" firmware-misc-nonfree nvidia-vaapi-driver
|
sudo apt install -y "$recommended" firmware-misc-nonfree nvidia-vaapi-driver
|
||||||
|
|
||||||
echo -e "${GREEN}NVIDIA drivers installed.${NC}"
|
echo -e "${GREEN}NVIDIA drivers installed.${NC}"
|
||||||
|
|||||||
+3
-3
@@ -50,12 +50,12 @@ finalize_deb822() {
|
|||||||
configure_repos() {
|
configure_repos() {
|
||||||
echo -e "${YELLOW}Repository configuration...${NC}"
|
echo -e "${YELLOW}Repository configuration...${NC}"
|
||||||
|
|
||||||
local use_deb822
|
local use_deb822=false
|
||||||
|
if [ "$DEBIAN_CODENAME" = "trixie" ]; then
|
||||||
if whiptail --title "Repository Format" --defaultno \
|
if whiptail --title "Repository Format" --defaultno \
|
||||||
--yesno "Use the modern .sources (deb822) format?\n(default is classic one-line style)" 10 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
|
||||||
else
|
fi
|
||||||
use_deb822=false
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local enable_backports
|
local enable_backports
|
||||||
|
|||||||
@@ -93,6 +93,30 @@ get_ram_summary() {
|
|||||||
echo "$RAM_SUMMARY"
|
echo "$RAM_SUMMARY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ----------------------------------
|
||||||
|
# Package installed check
|
||||||
|
# ----------------------------------
|
||||||
|
is_installed() {
|
||||||
|
dpkg -l "$1" 2>/dev/null | grep -q '^ii'
|
||||||
|
}
|
||||||
|
|
||||||
|
# ----------------------------------
|
||||||
|
# Package version lookup
|
||||||
|
# ----------------------------------
|
||||||
|
pkg_versions() {
|
||||||
|
local result=""
|
||||||
|
for pkg in "$@"; do
|
||||||
|
local ver
|
||||||
|
ver=$(apt-cache policy "$pkg" 2>/dev/null | awk 'NR==3 {print $2; exit}')
|
||||||
|
if [ -n "$ver" ] && [ "$ver" != "(none)" ]; then
|
||||||
|
result+=" - ${pkg} ${ver}\n"
|
||||||
|
else
|
||||||
|
result+=" - ${pkg}\n"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo -e "$result"
|
||||||
|
}
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
# Kernel version
|
# Kernel version
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# zram.sh - Configure compressed swap in RAM
|
||||||
|
|
||||||
|
install_zram() {
|
||||||
|
echo -e "${YELLOW}ZRAM Configuration${NC}"
|
||||||
|
|
||||||
|
if [ -z "$RAM_KB" ] || [ "$RAM_KB" -eq 0 ]; then
|
||||||
|
echo -e "${RED}Could not determine RAM size. Aborting.${NC}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local half_ram_mb=$((RAM_KB / 2 / 1024))
|
||||||
|
|
||||||
|
local algo
|
||||||
|
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." \
|
||||||
|
18 65 2 \
|
||||||
|
"lz4" "Fastest, lowest CPU usage (recommended)" \
|
||||||
|
"zstd" "Best ratio, slightly more CPU" \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
if [ -z "$algo" ]; then
|
||||||
|
echo "ZRAM configuration cancelled."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local zram_size
|
||||||
|
if whiptail --title "ZRAM Size" --yesno \
|
||||||
|
"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
|
||||||
|
else
|
||||||
|
zram_size=$(whiptail --title "ZRAM Size" --inputbox \
|
||||||
|
"Enter ZRAM size in MB:" 8 60 "$half_ram_mb" 3>&1 1>&2 2>&3)
|
||||||
|
if [ -z "$zram_size" ] || ! [[ "$zram_size" =~ ^[0-9]+$ ]]; then
|
||||||
|
echo "ZRAM configuration cancelled."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! whiptail --title "ZRAM Summary" --yesno \
|
||||||
|
"Algorithm: ${algo}\nSize: ${zram_size} MB (${RAM_SUMMARY} total)\nPriority: 100\n\nApply ZRAM configuration?" 13 60; then
|
||||||
|
echo "ZRAM configuration cancelled."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${YELLOW}Installing zram-tools...${NC}"
|
||||||
|
sudo apt install -y zram-tools
|
||||||
|
|
||||||
|
echo "Writing configuration..."
|
||||||
|
sudo tee /etc/default/zramswap > /dev/null <<EOF
|
||||||
|
ALGO=$algo
|
||||||
|
SIZE=$zram_size
|
||||||
|
PRIORITY=100
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "Restarting zramswap service..."
|
||||||
|
sudo systemctl restart zramswap
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo -e "${GREEN}ZRAM configured successfully.${NC}"
|
||||||
|
echo ""
|
||||||
|
sudo zramctl
|
||||||
|
echo ""
|
||||||
|
echo -e "${GREEN}You can verify with: sudo zramctl${NC}"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user