updated debian files

This commit is contained in:
[yuri]
2025-11-10 11:23:02 +01:00
parent eb90ddf11a
commit f502cecaab
10 changed files with 598 additions and 588 deletions

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_cyan() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}" TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}" INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
color_cyan
echo
echo "Starting Debian Chadwm setup..."
color_reset
echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
echo
# Pause # Pause
read -n 1 -s -r -p "Press any key to continue" read -n 1 -s -r -p "Press any key to continue"
echo

View File

@@ -2,17 +2,26 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_cyan() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -23,14 +32,23 @@ DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}" TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}" INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
# Pause # Pause before continuing
read -n 1 -s -r -p "Press any key to continue" read -n 1 -s -r -p "Press any key to continue"
# Before running FULL first run Minimal color_cyan
echo
echo "Running Debian Minimal setup first..."
color_reset
# Run the minimal setup
bash debian-minimal.sh bash debian-minimal.sh
# Now continue with FULL color_yellow
# install tools echo
echo "Continuing with Debian FULL installation..."
color_reset
# Install additional FULL packages
sudo apt install -y \ sudo apt install -y \
arandr \ arandr \
catfish \ catfish \
@@ -44,4 +62,7 @@ bash debian-minimal.sh
xcolors \ xcolors \
gparted gparted
color_green
echo
echo "Debian FULL installation packages installed."
color_reset

View File

@@ -2,17 +2,26 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_blue() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -24,18 +33,17 @@ TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}" INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
########################## ##########################
# 4. Desktop Environment installation # Desktop Environment installation
########################## ##########################
tput_yellow color_yellow
echo "Installing Gnome..." echo "Installing Gnome..."
tput_reset color_reset
#detect if Gnome and SDDM are installed and if not install them
if [[ -z "$DDE" ]]; then if [[ -z "$DDE" ]]; then
tput_cyan color_cyan
echo echo
echo "No Desktop Environment detected. Installing Gnome (light setup with SDDM)..." echo "No Desktop Environment detected. Installing Gnome (light setup with SDDM)..."
tput_reset color_reset
sudo apt update sudo apt update
sudo apt install -y --no-install-recommends sddm \ sudo apt install -y --no-install-recommends sddm \
@@ -56,23 +64,22 @@ if [[ -z "$DDE" ]]; then
# Enable graphical target # Enable graphical target
sudo systemctl set-default graphical.target sudo systemctl set-default graphical.target
tput_green color_green
echo echo
echo "Gnome with SDDM installed successfully." echo "Gnome with SDDM installed successfully."
echo "You can reboot now to start Gnome." echo "You can reboot now to start Gnome."
tput_reset color_reset
else else
tput_cyan color_cyan
echo echo
echo "You already have $DE installed." echo "You already have $DE installed."
tput_reset color_reset
# Check if LightDM is installed and active
if systemctl is-active --quiet lightdm; then if systemctl is-active --quiet lightdm; then
tput_yellow color_yellow
echo echo
echo "LightDM is currently active. Replacing with SDDM..." echo "LightDM is currently active. Replacing with SDDM..."
tput_reset color_reset
# Disable and remove LightDM # Disable and remove LightDM
sudo systemctl disable lightdm sudo systemctl disable lightdm
@@ -85,30 +92,25 @@ else
# Enable graphical target # Enable graphical target
sudo systemctl set-default graphical.target sudo systemctl set-default graphical.target
tput_green color_green
echo echo
echo "LightDM removed and replaced with SDDM." echo "LightDM removed and replaced with SDDM."
tput_reset color_reset
else else
tput_cyan color_cyan
echo echo
echo "No LightDM detected, leaving current display manager unchanged." echo "No LightDM detected, leaving current display manager unchanged."
tput_reset color_reset
fi fi
fi fi
#cleanup unwanted packages ##########################
# Packages to remove # Cleanup unwanted packages
##########################
# packages=("vim" "vim-runtime" "vim-common" "vim-tiny" "mousepad" "parole") # packages=("vim" "vim-runtime" "vim-common" "vim-tiny" "mousepad" "parole")
#sudo apt-mark manual xfce4-goodies is_package_installed() { dpkg -s "$1" &> /dev/null; }
# Function to check if a package is installed for package in "${packages[@]:-}"; do
is_package_installed() {
dpkg -s "$1" &> /dev/null
}
# Iterate over each package
for package in "${packages[@]}"; do
if is_package_installed "$package"; then if is_package_installed "$package"; then
echo "Removing $package..." echo "Removing $package..."
sudo apt-get purge -y "$package" sudo apt-get purge -y "$package"
@@ -116,7 +118,6 @@ fi
echo "$package is not installed, skipping." echo "$package is not installed, skipping."
fi fi
# Optional double-check
if ! is_package_installed "$package"; then if ! is_package_installed "$package"; then
echo "$package successfully removed." echo "$package successfully removed."
else else
@@ -127,9 +128,8 @@ fi
done done
# Resolving network issues # Resolving network issues
sudo mv /etc/network/interfaces /etc/network/interfaces.bak sudo mv /etc/network/interfaces /etc/network/interfaces.bak || true
sudo systemctl restart NetworkManager sudo systemctl restart NetworkManager
# Remove leftover dependencies # Remove leftover dependencies
sudo apt-get autoremove -y sudo apt-get autoremove -y

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_cyan() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}" TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}" INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
color_cyan
echo
echo "Starting Debian Hyprland setup..."
color_reset
echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
echo
# Pause # Pause
read -n 1 -s -r -p "Press any key to continue" read -n 1 -s -r -p "Press any key to continue"
echo

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_cyan() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -26,16 +36,15 @@ INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
# Pause # Pause
read -n 1 -s -r -p "Press any key to continue" read -n 1 -s -r -p "Press any key to continue"
# on all DE ##########################
#################################################################
# Create directories (skel + user) # Create directories (skel + user)
################################################################# ##########################
echo echo
tput setaf 2 color_green
echo "########################################################################" echo "########################################################################"
echo "################### Creating directories" echo "################### Creating directories"
echo "########################################################################" echo "########################################################################"
tput sgr0 color_reset
echo echo
sudo mkdir -p /etc/skel/.config/xfce4/{panel,xfconf} sudo mkdir -p /etc/skel/.config/xfce4/{panel,xfconf}
@@ -44,15 +53,15 @@ read -n 1 -s -r -p "Press any key to continue"
"$HOME/.local/share/"{icons,themes,applications} \ "$HOME/.local/share/"{icons,themes,applications} \
"$HOME/.config/"{autostart,gtk-{3.0,4.0},variety,fish,neofetch} "$HOME/.config/"{autostart,gtk-{3.0,4.0},variety,fish,neofetch}
# Packages to remove ##########################
# Remove unwanted packages
##########################
packages=("vim" "vim-runtime" "vim-common" "vim-tiny" "mousepad" "parole") packages=("vim" "vim-runtime" "vim-common" "vim-tiny" "mousepad" "parole")
# Function to check if a package is installed
is_package_installed() { is_package_installed() {
dpkg -s "$1" &> /dev/null dpkg -s "$1" &> /dev/null
} }
# Iterate over each package
for package in "${packages[@]}"; do for package in "${packages[@]}"; do
if is_package_installed "$package"; then if is_package_installed "$package"; then
echo "Removing $package..." echo "Removing $package..."
@@ -61,7 +70,6 @@ read -n 1 -s -r -p "Press any key to continue"
echo "$package is not installed, skipping." echo "$package is not installed, skipping."
fi fi
# Optional double-check
if ! is_package_installed "$package"; then if ! is_package_installed "$package"; then
echo "$package successfully removed." echo "$package successfully removed."
else else
@@ -71,140 +79,75 @@ read -n 1 -s -r -p "Press any key to continue"
echo "----------------------------" echo "----------------------------"
done done
# Remove leftover dependencies
sudo apt-get autoremove -y sudo apt-get autoremove -y
# install needed packages ##########################
#firmwares # Install needed packages
sudo apt-get install -y \ ##########################
dkms \ # Firmware / headers
linux-headers-$(uname -r) sudo apt-get install -y dkms linux-headers-$(uname -r)
#archive-managers # Archive managers
sudo apt install -y zip gzip p7zip unace unrar unzip sudo apt install -y zip gzip p7zip unace unrar unzip file-roller
#fonts # Fonts
sudo apt install -y \ sudo apt install -y font-manager fonts-noto fonts-dejavu fonts-droid-fallback \
font-manager \ fonts-hack fonts-inconsolata fonts-liberation fonts-roboto fonts-ubuntu fonts-terminus
fonts-noto \
fonts-dejavu \
fonts-droid-fallback \
fonts-hack \
fonts-inconsolata \
fonts-liberation \
fonts-roboto \
fonts-ubuntu \
fonts-terminus
# Install RobotoMono Nerd Font # RobotoMono Nerd Font
# Destination directory
FONT_DIR="$HOME/.local/share/fonts" FONT_DIR="$HOME/.local/share/fonts"
mkdir -p "$FONT_DIR" mkdir -p "$FONT_DIR"
# Download RobotoMono Nerd Font (latest release)
ZIP_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/RobotoMono.zip" ZIP_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/RobotoMono.zip"
TMP_DIR="$(mktemp -d)" TMP_DIR="$(mktemp -d)"
echo "Downloading RobotoMono Nerd Font..." echo "Downloading RobotoMono Nerd Font..."
curl -L "$ZIP_URL" -o "$TMP_DIR/RobotoMono.zip" curl -L "$ZIP_URL" -o "$TMP_DIR/RobotoMono.zip"
echo "Extracting..." echo "Extracting..."
unzip -q "$TMP_DIR/RobotoMono.zip" -d "$FONT_DIR" unzip -q "$TMP_DIR/RobotoMono.zip" -d "$FONT_DIR"
echo "Cleaning up..."
rm -rf "$TMP_DIR" rm -rf "$TMP_DIR"
echo "Updating font cache..." echo "Updating font cache..."
fc-cache -fv fc-cache -fv
echo "RobotoMono Nerd Font installed successfully in $FONT_DIR" echo "RobotoMono Nerd Font installed successfully in $FONT_DIR"
#tools # Tools
sudo apt install -y \ sudo apt install -y wget curl nano fastfetch lolcat bash-completion starship alacritty \
wget \ hwinfo lshw libpam0g libpam-modules libpam-runtime libpam-modules-bin \
curl \ avahi-daemon avahi-utils libnss-mdns man-db manpages tree xdg-user-dirs \
nano \ mate-polkit rsync time bat chrony duf
fastfetch \
lolcat \
bash-completion \
starship \
alacritty \
hwinfo \
lshw \
libpam0g \
libpam-modules \
libpam-runtime \
libpam-modules-bin \
avahi-daemon \
avahi-utils \
libnss-mdns
if [ ! -f /usr/bin/duf ]; then # Theming
sudo apt install -y duf sudo apt install -y bibata-cursor-theme feh arc-theme
fi
sudo apt install -y \
man-db \
manpages \
tree \
xdg-user-dirs \
mate-polkit \
rsync \
time \
bat \
chrony
#theming
sudo apt install -y \
bibata-cursor-theme \
feh \
arc-theme
# Surfn icon theme
echo "Installing Surfn icon theme..." echo "Installing Surfn icon theme..."
# Clone Surfn repo
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
git clone https://github.com/erikdubois/Surfn.git "$TEMP_DIR/surfn" git clone https://github.com/erikdubois/Surfn.git "$TEMP_DIR/surfn"
cd "$TEMP_DIR/surfn" cp -r "$TEMP_DIR/surfn/surfn-icons/" ~/.icons/
# Copy the icon theme to the user's local icons directory
cp -r surfn-icons/* ~/.icons/
cd ~
rm -rf "$TEMP_DIR" rm -rf "$TEMP_DIR"
echo "Surfn icon theme installed." echo "Surfn icon theme installed."
# Flat Remix Dark GTK theme
echo "Installing Flat Remix Dark GTK theme..." echo "Installing Flat Remix Dark GTK theme..."
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR" cd "$TEMP_DIR"
# Download latest master as tar.gz
wget -O flat-remix-gtk.tar.gz https://github.com/daniruiz/flat-remix-gtk/archive/refs/heads/master.tar.gz wget -O flat-remix-gtk.tar.gz https://github.com/daniruiz/flat-remix-gtk/archive/refs/heads/master.tar.gz
# Extract
tar -xzf flat-remix-gtk.tar.gz tar -xzf flat-remix-gtk.tar.gz
# Move the Dark GTK theme to ~/.themes
# The actual theme folder is "Flat-Remix-Dark" inside the extracted directory
mv flat-remix-gtk-master/themes/* ~/.themes/ mv flat-remix-gtk-master/themes/* ~/.themes/
cd ~ cd ~
rm -rf "$TEMP_DIR" rm -rf "$TEMP_DIR"
echo "Flat Remix Dark GTK theme installed." echo "Flat Remix Dark GTK theme installed."
#internet # Internet
sudo apt install -y \ sudo apt install -y chromium
chromium
#enable services # Enable services
sudo systemctl enable avahi-daemon.service sudo systemctl enable avahi-daemon.service
sudo systemctl enable chrony sudo systemctl enable chrony
#Run service that will discard unused blocks on mounted filesystems. This is useful for solid-state drives (SSDs) and thinly-provisioned storage.
echo
echo "Enable fstrim timer"
sudo systemctl enable fstrim.timer sudo systemctl enable fstrim.timer
echo ##########################
tput setaf 3 # Detect virtualization platform
echo "########################################################################" ##########################
echo "Detecting virtualization platform..." echo "Detecting virtualization platform..."
echo "########################################################################"
tput sgr0
echo
virt_type=$(systemd-detect-virt) virt_type=$(systemd-detect-virt)
case "$virt_type" in case "$virt_type" in
@@ -226,40 +169,19 @@ read -n 1 -s -r -p "Press any key to continue"
;; ;;
esac esac
# if on XFCE ##########################
case "$DE" in # XFCE-specific setup
xfce) ##########################
################################################################# if [[ "$DE" == "xfce" ]]; then
# Create directories (skel + user) echo "Setting up XFCE directories..."
#################################################################
echo
tput setaf 2
echo "########################################################################"
echo "################### Creating directories"
echo "########################################################################"
tput sgr0
echo
sudo mkdir -p /etc/skel/.config/xfce4/{panel,xfconf} sudo mkdir -p /etc/skel/.config/xfce4/{panel,xfconf}
mkdir -p \ mkdir -p "$HOME/.config/"{xfce4,xfce4/xfconf}
"$HOME/.config/"{xfce4,xfce4/xfconf}
# cleanup unwanted packages # Cleanup unwanted packages
tput_yellow echo "Removing unwanted packages from XFCE..."
echo
echo "Removing unwanted packages from $DE..."
tput_reset
# Packages to remove
packages=("xfburn" "xfce4-screenshooter" "xfce4-notes") packages=("xfburn" "xfce4-screenshooter" "xfce4-notes")
sudo apt-mark manual xfce4-goodies sudo apt-mark manual xfce4-goodies
# Function to check if a package is installed
is_package_installed() {
dpkg -s "$1" &> /dev/null
}
# Iterate over each package
for package in "${packages[@]}"; do for package in "${packages[@]}"; do
if is_package_installed "$package"; then if is_package_installed "$package"; then
echo "Removing $package..." echo "Removing $package..."
@@ -268,7 +190,6 @@ case "$DE" in
echo "$package is not installed, skipping." echo "$package is not installed, skipping."
fi fi
# Optional double-check
if ! is_package_installed "$package"; then if ! is_package_installed "$package"; then
echo "$package successfully removed." echo "$package successfully removed."
else else
@@ -278,21 +199,8 @@ case "$DE" in
echo "----------------------------" echo "----------------------------"
done done
# Remove leftover dependencies
sudo apt-get autoremove -y sudo apt-get autoremove -y
# install needed packages # Install XFCE tools
#tools
sudo apt install -y thunar thunar-archive-plugin thunar-volman sudo apt install -y thunar thunar-archive-plugin thunar-volman
fi
#archive-managers
sudo apt install -y file-roller
;;
esac

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_blue() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -26,60 +36,49 @@ INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
########################## ##########################
# 4. Desktop Environment installation # 4. Desktop Environment installation
########################## ##########################
tput_yellow color_yellow
echo "Installing KDE Plasma..." echo "Installing KDE Plasma..."
tput_reset color_reset
#detect if KDE Plasma and SDDM are installed and if not install them # Detect if KDE Plasma and SDDM are installed and install if needed
if [[ -z "$DDE" ]]; then if [[ -z "$DDE" ]]; then
tput_cyan color_cyan
echo echo
echo "No Desktop Environment detected. Installing KDE Plasma (light setup with SDDM)..." echo "No Desktop Environment detected. Installing KDE Plasma (light setup with SDDM)..."
tput_reset color_reset
sudo apt update sudo apt update
sudo apt install -y --no-install-recommends sddm \ sudo apt install -y --no-install-recommends sddm \
plasma-desktop \ plasma-desktop dolphin konsole kate \
dolphin \ plasma-nm plasma-workspace kde-config-gtk-style \
konsole \ kde-config-sddm plasma-discover plasma-discover-common \
kate \ plasma-discover-backend-snap plasma-discover-backend-flatpak \
plasma-nm \ plasma-discover-backend-fwupd kscreen
plasma-workspace \
kde-config-gtk-style \
kde-config-sddm \
plasma-discover \
plasma-discover-common \
plasma-discover-backend-snap \
plasma-discover-backend-flatpak \
plasma-discover-backend-fwupd \
kscreen
# Enable SDDM as the display manager # Enable SDDM as the display manager
sudo systemctl enable sddm sudo systemctl enable sddm
# Enable graphical target
sudo systemctl set-default graphical.target sudo systemctl set-default graphical.target
# Rebuild Discover cache # Rebuild Discover cache
kbuildsycoca6 kbuildsycoca6
tput_green color_green
echo echo
echo "KDE Plasma with SDDM installed successfully." echo "KDE Plasma with SDDM installed successfully."
echo "You can reboot now to start KDE Plasma." echo "You can reboot now to start KDE Plasma."
tput_reset color_reset
else else
tput_cyan color_cyan
echo echo
echo "You already have $DE installed." echo "You already have $DE installed."
tput_reset color_reset
# Check if LightDM is installed and active # Check if LightDM is installed and active
if systemctl is-active --quiet lightdm; then if systemctl is-active --quiet lightdm; then
tput_yellow color_yellow
echo echo
echo "LightDM is currently active. Replacing with SDDM..." echo "LightDM is currently active. Replacing with SDDM..."
tput_reset color_reset
# Disable and remove LightDM # Disable and remove LightDM
sudo systemctl disable lightdm sudo systemctl disable lightdm
@@ -88,33 +87,30 @@ else
# Install and enable SDDM # Install and enable SDDM
sudo apt install -y sddm sudo apt install -y sddm
sudo systemctl enable sddm sudo systemctl enable sddm
# Enable graphical target
sudo systemctl set-default graphical.target sudo systemctl set-default graphical.target
tput_green color_green
echo echo
echo "LightDM removed and replaced with SDDM." echo "LightDM removed and replaced with SDDM."
tput_reset color_reset
else else
tput_cyan color_cyan
echo echo
echo "No LightDM detected, leaving current display manager unchanged." echo "No LightDM detected, leaving current display manager unchanged."
tput_reset color_reset
fi fi
fi fi
#cleanup unwanted packages ##########################
# Packages to remove # Cleanup unwanted packages
#packages=("vim" "vim-runtime" "vim-common" "vim-tiny" "mousepad" "parole") ##########################
#sudo apt-mark manual xfce4-goodies # Define packages to remove (example)
packages=("vim" "vim-runtime" "vim-common" "vim-tiny" "mousepad" "parole")
# Function to check if a package is installed
is_package_installed() { is_package_installed() {
dpkg -s "$1" &> /dev/null dpkg -s "$1" &> /dev/null
} }
# Iterate over each package
for package in "${packages[@]}"; do for package in "${packages[@]}"; do
if is_package_installed "$package"; then if is_package_installed "$package"; then
echo "Removing $package..." echo "Removing $package..."
@@ -133,10 +129,11 @@ fi
echo "----------------------------" echo "----------------------------"
done done
# Resolving network issues ##########################
# Network cleanup
##########################
sudo mv /etc/network/interfaces /etc/network/interfaces.bak sudo mv /etc/network/interfaces /etc/network/interfaces.bak
sudo systemctl restart NetworkManager sudo systemctl restart NetworkManager
# Remove leftover dependencies # Remove leftover dependencies
sudo apt-get autoremove -y sudo apt-get autoremove -y

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_cyan() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}" TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}" INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
color_cyan
echo
echo "Starting Debian Server setup..."
color_reset
echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
echo
# Pause # Pause
read -n 1 -s -r -p "Press any key to continue" read -n 1 -s -r -p "Press any key to continue"
echo

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_cyan() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}" TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}" INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
color_cyan
echo
echo "Starting Debian Workstation setup..."
color_reset
echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
echo
# Pause # Pause
read -n 1 -s -r -p "Press any key to continue" read -n 1 -s -r -p "Press any key to continue"
echo

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_blue() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -26,21 +36,19 @@ INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
########################## ##########################
# 4. Desktop Environment installation # 4. Desktop Environment installation
########################## ##########################
tput_yellow color_yellow
echo "Installing XFCE..." echo "Installing XFCE..."
tput_reset color_reset
#detect if XFCE and SDDM are installed and if not install them # Detect if XFCE and SDDM are installed and install if needed
if [[ -z "$DDE" ]]; then if [[ -z "$DDE" ]]; then
tput_cyan color_cyan
echo echo
echo "No Desktop Environment detected. Installing XFCE (light setup with SDDM)..." echo "No Desktop Environment detected. Installing XFCE (light setup with SDDM)..."
tput_reset color_reset
sudo apt update sudo apt update
sudo apt install -y --no-install-recommends sddm \ sudo apt install -y --no-install-recommends sddm xfce4 xfce4-goodies
xfce4 \
xfce4-goodies
# Enable SDDM as the display manager # Enable SDDM as the display manager
sudo systemctl enable sddm sudo systemctl enable sddm
@@ -48,23 +56,23 @@ if [[ -z "$DDE" ]]; then
# Enable graphical target # Enable graphical target
sudo systemctl set-default graphical.target sudo systemctl set-default graphical.target
tput_green color_green
echo echo
echo "XFCE with SDDM installed successfully." echo "XFCE with SDDM installed successfully."
echo "You can reboot now to start XFCE." echo "You can reboot now to start XFCE."
tput_reset color_reset
else else
tput_cyan color_cyan
echo echo
echo "You already have $DE installed." echo "You already have $DE installed."
tput_reset color_reset
# Check if LightDM is installed and active # Check if LightDM is installed and active
if systemctl is-active --quiet lightdm; then if systemctl is-active --quiet lightdm; then
tput_yellow color_yellow
echo echo
echo "LightDM is currently active. Replacing with SDDM..." echo "LightDM is currently active. Replacing with SDDM..."
tput_reset color_reset
# Disable and remove LightDM # Disable and remove LightDM
sudo systemctl disable lightdm sudo systemctl disable lightdm
@@ -74,14 +82,14 @@ else
sudo apt install -y sddm sudo apt install -y sddm
sudo systemctl enable sddm sudo systemctl enable sddm
tput_green color_green
echo echo
echo "LightDM removed and replaced with SDDM." echo "LightDM removed and replaced with SDDM."
tput_reset color_reset
else else
tput_cyan color_cyan
echo echo
echo "No LightDM detected, leaving current display manager unchanged." echo "No LightDM detected, leaving current display manager unchanged."
tput_reset color_reset
fi fi
fi fi

View File

@@ -2,17 +2,27 @@
set -euo pipefail set -euo pipefail
########################## ##########################
# Color helpers # Color helpers (no tput)
########################## ##########################
tput_reset() { tput sgr0; } RED='\033[0;31m'
tput_black() { tput setaf 0; } GREEN='\033[0;32m'
tput_red() { tput setaf 1; } YELLOW='\033[0;33m'
tput_green() { tput setaf 2; } CYAN='\033[0;36m'
tput_yellow() { tput setaf 3; } GRAY='\033[0;37m'
tput_cyan() { tput setaf 4; } BOLD='\033[1m'
tput_purple() { tput setaf 5; } RESET='\033[0m'
tput_cyan() { tput setaf 6; }
tput_gray() { tput setaf 7; } # Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
########################## ##########################
# Use exported variables from main detection script # Use exported variables from main detection script
@@ -23,10 +33,10 @@ DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}" TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}" INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
tput_cyan color_cyan
echo echo
echo "Starting Debian setup..." echo "Starting Debian setup..."
tput_reset color_reset
echo echo
echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL" echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
@@ -34,10 +44,10 @@ echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
# 0. Ensure curl is installed # 0. Ensure curl is installed
########################## ##########################
if ! command -v curl >/dev/null 2>&1; then if ! command -v curl >/dev/null 2>&1; then
tput_yellow color_yellow
echo echo
echo "curl is not installed. Installing..." echo "curl is not installed. Installing..."
tput_reset color_reset
sudo apt update sudo apt update
sudo apt -y install curl sudo apt -y install curl
fi fi
@@ -45,24 +55,23 @@ fi
########################## ##########################
# 1. Add contrib and non-free if missing # 1. Add contrib and non-free if missing
########################## ##########################
tput_yellow color_yellow
echo echo
echo "Checking /etc/apt/sources.list for contrib/non-free..." echo "Checking /etc/apt/sources.list for contrib/non-free..."
tput_reset color_reset
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak.$(date +%s) sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak.$(date +%s)
sudo sed -i -r 's/^(deb\s+\S+\s+\S+)\s+(main)$/\1 main contrib non-free/' /etc/apt/sources.list sudo sed -i -r 's/^(deb\s+\S+\s+\S+)\s+(main)$/\1 main contrib non-free/' /etc/apt/sources.list
tput_green color_green
echo echo
echo "Updated sources.list to include contrib/non-free where needed." echo "Updated sources.list to include contrib/non-free where needed."
tput_reset color_reset
########################## ##########################
# 1a. Check for archive.debian.org and update to deb.debian.org (only if Bullseye or newer) # 1a. Update archive.debian.org if needed
########################## ##########################
CURRENT_CODENAME=$(grep -Po 'deb\s+\S+\s+\K\S+' /etc/apt/sources.list | grep -E '^(buster|bullseye|bookworm|trixie)$' | head -n1) CURRENT_CODENAME=$(grep -Po 'deb\s+\S+\s+\K\S+' /etc/apt/sources.list | grep -E '^(buster|bullseye|bookworm|trixie)$' | head -n1)
DEBIAN_ORDER=(buster bullseye bookworm trixie) DEBIAN_ORDER=(buster bullseye bookworm trixie)
# Function to get numeric index of codename
codename_index() { codename_index() {
local code="$1" local code="$1"
for i in "${!DEBIAN_ORDER[@]}"; do for i in "${!DEBIAN_ORDER[@]}"; do
@@ -75,80 +84,80 @@ CURRENT_INDEX=$(codename_index "$CURRENT_CODENAME")
BULLSEYE_INDEX=$(codename_index "bullseye") BULLSEYE_INDEX=$(codename_index "bullseye")
if [[ "$CURRENT_INDEX" -ge "$BULLSEYE_INDEX" ]] && grep -q "archive.debian.org" /etc/apt/sources.list; then if [[ "$CURRENT_INDEX" -ge "$BULLSEYE_INDEX" ]] && grep -q "archive.debian.org" /etc/apt/sources.list; then
tput_yellow color_yellow
echo echo
echo "Found archive.debian.org in sources.list and system is Bullseye or newer, updating to deb.debian.org..." echo "Found archive.debian.org in sources.list and system is Bullseye or newer, updating to deb.debian.org..."
tput_reset color_reset
sudo sed -i -r 's|archive\.debian\.org|deb.debian.org|g' /etc/apt/sources.list sudo sed -i -r 's|archive\.debian\.org|deb.debian.org|g' /etc/apt/sources.list
tput_green color_green
echo echo
echo "Updated sources.list to use deb.debian.org." echo "Updated sources.list to use deb.debian.org."
tput_reset color_reset
fi fi
########################## ##########################
# 2. Full update and upgrade # 2. Full update and upgrade
########################## ##########################
tput_yellow color_yellow
echo echo
echo "Updating package lists..." echo "Updating package lists..."
tput_reset color_reset
sudo apt update sudo apt update
# Autoremove before full-upgrade # Autoremove before full-upgrade
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true) AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
if [[ -n "$AUTOREMOVE_PENDING" ]]; then if [[ -n "$AUTOREMOVE_PENDING" ]]; then
tput_yellow color_yellow
echo echo
echo "Removing packages that are no longer required before upgrade..." echo "Removing packages that are no longer required before upgrade..."
tput_reset color_reset
sudo apt -y autoremove sudo apt -y autoremove
fi fi
tput_yellow color_yellow
echo echo
echo "Upgrading installed packages..." echo "Upgrading installed packages..."
tput_reset color_reset
sudo apt -y full-upgrade sudo apt -y full-upgrade
# Autoremove after full-upgrade # Autoremove after full-upgrade
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true) AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
if [[ -n "$AUTOREMOVE_PENDING" ]]; then if [[ -n "$AUTOREMOVE_PENDING" ]]; then
tput_yellow color_yellow
echo echo
echo "Removing packages that are no longer required after upgrade..." echo "Removing packages that are no longer required after upgrade..."
tput_reset color_reset
sudo apt -y autoremove sudo apt -y autoremove
fi fi
UPGRADE_PENDING=$(apt list --upgradable 2>/dev/null | grep -v Listing || true) UPGRADE_PENDING=$(apt list --upgradable 2>/dev/null | grep -v Listing || true)
if [[ -n "$UPGRADE_PENDING" ]]; then if [[ -n "$UPGRADE_PENDING" ]]; then
tput_red color_red
echo echo
echo "Some packages were upgraded. A reboot is recommended before continuing." echo "Some packages were upgraded. A reboot is recommended before continuing."
tput_reset color_reset
read -rp "Reboot now? [y/N]: " reboot_choice read -rp "Reboot now? [y/N]: " reboot_choice
case "${reboot_choice,,}" in case "${reboot_choice,,}" in
y|yes) y|yes)
tput_red color_red
echo echo
echo "Rebooting now. After reboot, please restart this script to continue..." echo "Rebooting now. After reboot, please restart this script to continue..."
tput_reset color_reset
sudo reboot sudo reboot
;; ;;
*) *)
tput_yellow color_yellow
echo echo
echo "Skipping reboot. Make sure to reboot manually before continuing upgrades." echo "Skipping reboot. Make sure to reboot manually before continuing upgrades."
tput_reset color_reset
exit 0 exit 0
;; ;;
esac esac
else else
tput_green color_green
echo echo
echo "All packages are up to date. Continuing to Debian major version check..." echo "All packages are up to date. Continuing to Debian major version check..."
tput_reset color_reset
fi fi
########################## ##########################
@@ -158,11 +167,11 @@ DEBIAN_SEQUENCE=(buster bullseye bookworm trixie)
CURRENT_CODENAME=$(grep -Po 'deb\s+\S+\s+\K\S+' /etc/apt/sources.list | grep -E '^(buster|bullseye|bookworm|trixie)$' | head -n1) CURRENT_CODENAME=$(grep -Po 'deb\s+\S+\s+\K\S+' /etc/apt/sources.list | grep -E '^(buster|bullseye|bookworm|trixie)$' | head -n1)
LATEST_CODENAME=${DEBIAN_SEQUENCE[-1]} LATEST_CODENAME=${DEBIAN_SEQUENCE[-1]}
tput_cyan color_cyan
echo echo
echo "Current codename: $CURRENT_CODENAME" echo "Current codename: $CURRENT_CODENAME"
echo "Latest stable codename: $LATEST_CODENAME" echo "Latest stable codename: $LATEST_CODENAME"
tput_reset color_reset
while [[ "$CURRENT_CODENAME" != "$LATEST_CODENAME" ]]; do while [[ "$CURRENT_CODENAME" != "$LATEST_CODENAME" ]]; do
NEXT_CODENAME="" NEXT_CODENAME=""
@@ -174,66 +183,64 @@ while [[ "$CURRENT_CODENAME" != "$LATEST_CODENAME" ]]; do
done done
if [[ -z "$NEXT_CODENAME" ]]; then if [[ -z "$NEXT_CODENAME" ]]; then
tput_red color_red
echo echo
echo "Error: Cannot determine next codename after $CURRENT_CODENAME" echo "Error: Cannot determine next codename after $CURRENT_CODENAME"
tput_reset color_reset
exit 1 exit 1
fi fi
tput_yellow color_yellow
echo echo
echo "Detected codename $CURRENT_CODENAME, next stable version: $NEXT_CODENAME" echo "Detected codename $CURRENT_CODENAME, next stable version: $NEXT_CODENAME"
tput_reset color_reset
read -rp "Do you want to upgrade to $NEXT_CODENAME? [y/N]: " choice read -rp "Do you want to upgrade to $NEXT_CODENAME? [y/N]: " choice
case "${choice,,}" in case "${choice,,}" in
y|yes) y|yes)
tput_yellow color_yellow
echo echo
echo "Updating sources.list to $NEXT_CODENAME..." echo "Updating sources.list to $NEXT_CODENAME..."
tput_reset color_reset
sudo sed -i -r "s/\b$CURRENT_CODENAME\b/$NEXT_CODENAME/g" /etc/apt/sources.list sudo sed -i -r "s/\b$CURRENT_CODENAME\b/$NEXT_CODENAME/g" /etc/apt/sources.list
tput_yellow color_yellow
echo echo
echo "Updating packages..." echo "Updating packages..."
tput_reset color_reset
sudo apt update sudo apt update
# Autoremove before full-upgrade
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true) AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
if [[ -n "$AUTOREMOVE_PENDING" ]]; then if [[ -n "$AUTOREMOVE_PENDING" ]]; then
tput_yellow color_yellow
echo echo
echo "Removing packages that are no longer required before upgrade..." echo "Removing packages that are no longer required before upgrade..."
tput_reset color_reset
sudo apt -y autoremove sudo apt -y autoremove
fi fi
sudo apt -y full-upgrade sudo apt -y full-upgrade
# Autoremove after full-upgrade
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true) AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
if [[ -n "$AUTOREMOVE_PENDING" ]]; then if [[ -n "$AUTOREMOVE_PENDING" ]]; then
tput_yellow color_yellow
echo echo
echo "Removing packages that are no longer required after upgrade..." echo "Removing packages that are no longer required after upgrade..."
tput_reset color_reset
sudo apt -y autoremove sudo apt -y autoremove
fi fi
tput_green color_green
echo echo
echo "Upgrade to $NEXT_CODENAME complete. A reboot is recommended." echo "Upgrade to $NEXT_CODENAME complete. A reboot is recommended."
tput_reset color_reset
read -rp "Press Enter to reboot..." _ read -rp "Press Enter to reboot..." _
sudo reboot sudo reboot
;; ;;
*) *)
tput_yellow color_yellow
echo echo
echo "Skipping upgrade to $NEXT_CODENAME. Continuing with current version." echo "Skipping upgrade to $NEXT_CODENAME. Continuing with current version."
tput_reset color_reset
break break
;; ;;
esac esac
@@ -241,42 +248,41 @@ while [[ "$CURRENT_CODENAME" != "$LATEST_CODENAME" ]]; do
CURRENT_CODENAME=$(grep -Po 'deb\s+\S+\s+\K\S+' /etc/apt/sources.list | grep -E '^(buster|bullseye|bookworm|trixie)$' | head -n1) CURRENT_CODENAME=$(grep -Po 'deb\s+\S+\s+\K\S+' /etc/apt/sources.list | grep -E '^(buster|bullseye|bookworm|trixie)$' | head -n1)
done done
tput_green color_green
echo echo
echo "Debian is now at codename $CURRENT_CODENAME. Continuing with DE/TWM installation..." echo "Debian is now at codename $CURRENT_CODENAME. Continuing with DE/TWM installation..."
tput_reset color_reset
########################## ##########################
# 4. Desktop Environment installation # 4. Desktop Environment installation
########################## ##########################
case "$DE" in case "$DE" in
xfce|plasma|gnome) xfce|plasma|gnome)
tput_yellow color_yellow
echo echo
echo "Preparing to install $DE..." echo "Preparing to install $DE..."
tput_reset color_reset
# Run DE-specific script dynamically
SCRIPT_NAME="${OS}-${DE}.sh" SCRIPT_NAME="${OS}-${DE}.sh"
if [[ -f "$SCRIPT_NAME" ]]; then if [[ -f "$SCRIPT_NAME" ]]; then
tput_cyan color_cyan
echo echo
echo "Running $SCRIPT_NAME..." echo "Running $SCRIPT_NAME..."
tput_reset color_reset
bash "$SCRIPT_NAME" bash "$SCRIPT_NAME"
else else
tput_red color_red
echo echo
echo "Error: $SCRIPT_NAME not found!" echo "Error: $SCRIPT_NAME not found!"
tput_reset color_reset
exit 1 exit 1
fi fi
;; ;;
none) none)
tput_gray color_gray
echo echo
echo "No Desktop Environment selected, skipping DE installation." echo "No Desktop Environment selected, skipping DE installation."
tput_reset color_reset
;; ;;
esac esac
@@ -285,32 +291,31 @@ esac
########################## ##########################
case "$TWM" in case "$TWM" in
chadwm|hyprland) chadwm|hyprland)
tput_yellow color_yellow
echo echo
echo "Installing CHADWM..." echo "Installing $TWM..."
tput_reset color_reset
# Run TWM-specific script dynamically
SCRIPT_NAME="${OS}-${TWM}.sh" SCRIPT_NAME="${OS}-${TWM}.sh"
if [[ -f "$SCRIPT_NAME" ]]; then if [[ -f "$SCRIPT_NAME" ]]; then
tput_cyan color_cyan
echo echo
echo "Running $SCRIPT_NAME..." echo "Running $SCRIPT_NAME..."
tput_reset color_reset
bash "$SCRIPT_NAME" bash "$SCRIPT_NAME"
else else
tput_red color_red
echo echo
echo "Error: $SCRIPT_NAME not found!" echo "Error: $SCRIPT_NAME not found!"
tput_reset color_reset
exit 1 exit 1
fi fi
;; ;;
none) none)
tput_gray color_gray
echo echo
echo "No tiling window manager selected." echo "No tiling window manager selected."
tput_reset color_reset
;; ;;
esac esac
@@ -319,30 +324,29 @@ esac
########################## ##########################
case "$INSTALL_LEVEL" in case "$INSTALL_LEVEL" in
minimal|full|workstation|server) minimal|full|workstation|server)
tput_cyan color_cyan
echo echo
echo "Minimal installation selected." echo "Installation level: $INSTALL_LEVEL"
tput_reset color_reset
# Run Installation Level-specific script dynamically
SCRIPT_NAME="${OS}-${INSTALL_LEVEL}.sh" SCRIPT_NAME="${OS}-${INSTALL_LEVEL}.sh"
if [[ -f "$SCRIPT_NAME" ]]; then if [[ -f "$SCRIPT_NAME" ]]; then
tput_cyan color_cyan
echo echo
echo "Running $SCRIPT_NAME..." echo "Running $SCRIPT_NAME..."
tput_reset color_reset
bash "$SCRIPT_NAME" bash "$SCRIPT_NAME"
else else
tput_red color_red
echo echo
echo "Error: $SCRIPT_NAME not found!" echo "Error: $SCRIPT_NAME not found!"
tput_reset color_reset
exit 1 exit 1
fi fi
;; ;;
esac esac
tput_green color_green
echo echo
echo "Debian setup complete." echo "Debian setup complete."
tput_reset color_reset