updated debian files
This commit is contained in:
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_cyan() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
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
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
|
||||
@@ -2,17 +2,26 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_cyan() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
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
|
||||
@@ -23,14 +32,23 @@ DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
|
||||
# Pause
|
||||
# Pause before continuing
|
||||
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
|
||||
|
||||
# Now continue with FULL
|
||||
# install tools
|
||||
color_yellow
|
||||
echo
|
||||
echo "Continuing with Debian FULL installation..."
|
||||
color_reset
|
||||
|
||||
# Install additional FULL packages
|
||||
sudo apt install -y \
|
||||
arandr \
|
||||
catfish \
|
||||
@@ -44,4 +62,7 @@ bash debian-minimal.sh
|
||||
xcolors \
|
||||
gparted
|
||||
|
||||
|
||||
color_green
|
||||
echo
|
||||
echo "Debian FULL installation packages installed."
|
||||
color_reset
|
||||
|
||||
@@ -2,17 +2,26 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_blue() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
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
|
||||
@@ -24,18 +33,17 @@ TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
|
||||
##########################
|
||||
# 4. Desktop Environment installation
|
||||
# Desktop Environment installation
|
||||
##########################
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo "Installing Gnome..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
#detect if Gnome and SDDM are installed and if not install them
|
||||
if [[ -z "$DDE" ]]; then
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "No Desktop Environment detected. Installing Gnome (light setup with SDDM)..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends sddm \
|
||||
@@ -56,23 +64,22 @@ if [[ -z "$DDE" ]]; then
|
||||
# Enable graphical target
|
||||
sudo systemctl set-default graphical.target
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "Gnome with SDDM installed successfully."
|
||||
echo "You can reboot now to start Gnome."
|
||||
tput_reset
|
||||
color_reset
|
||||
else
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "You already have $DE installed."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
# Check if LightDM is installed and active
|
||||
if systemctl is-active --quiet lightdm; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "LightDM is currently active. Replacing with SDDM..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
# Disable and remove LightDM
|
||||
sudo systemctl disable lightdm
|
||||
@@ -85,30 +92,25 @@ else
|
||||
# Enable graphical target
|
||||
sudo systemctl set-default graphical.target
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "LightDM removed and replaced with SDDM."
|
||||
tput_reset
|
||||
color_reset
|
||||
else
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "No LightDM detected, leaving current display manager unchanged."
|
||||
tput_reset
|
||||
color_reset
|
||||
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
|
||||
is_package_installed() { dpkg -s "$1" &> /dev/null; }
|
||||
|
||||
# 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
|
||||
echo "Removing $package..."
|
||||
sudo apt-get purge -y "$package"
|
||||
@@ -116,7 +118,6 @@ fi
|
||||
echo "$package is not installed, skipping."
|
||||
fi
|
||||
|
||||
# Optional double-check
|
||||
if ! is_package_installed "$package"; then
|
||||
echo "$package successfully removed."
|
||||
else
|
||||
@@ -127,9 +128,8 @@ fi
|
||||
done
|
||||
|
||||
# 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
|
||||
|
||||
# Remove leftover dependencies
|
||||
sudo apt-get autoremove -y
|
||||
|
||||
|
||||
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_cyan() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
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
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
|
||||
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_cyan() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -26,16 +36,15 @@ INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
# Pause
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
|
||||
# on all DE
|
||||
#################################################################
|
||||
##########################
|
||||
# Create directories (skel + user)
|
||||
#################################################################
|
||||
##########################
|
||||
echo
|
||||
tput setaf 2
|
||||
color_green
|
||||
echo "########################################################################"
|
||||
echo "################### Creating directories"
|
||||
echo "########################################################################"
|
||||
tput sgr0
|
||||
color_reset
|
||||
echo
|
||||
|
||||
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/.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")
|
||||
|
||||
# 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
|
||||
if is_package_installed "$package"; then
|
||||
echo "Removing $package..."
|
||||
@@ -61,7 +70,6 @@ read -n 1 -s -r -p "Press any key to continue"
|
||||
echo "$package is not installed, skipping."
|
||||
fi
|
||||
|
||||
# Optional double-check
|
||||
if ! is_package_installed "$package"; then
|
||||
echo "$package successfully removed."
|
||||
else
|
||||
@@ -71,140 +79,75 @@ read -n 1 -s -r -p "Press any key to continue"
|
||||
echo "----------------------------"
|
||||
done
|
||||
|
||||
# Remove leftover dependencies
|
||||
sudo apt-get autoremove -y
|
||||
|
||||
# install needed packages
|
||||
#firmwares
|
||||
sudo apt-get install -y \
|
||||
dkms \
|
||||
linux-headers-$(uname -r)
|
||||
##########################
|
||||
# Install needed packages
|
||||
##########################
|
||||
# Firmware / headers
|
||||
sudo apt-get install -y dkms linux-headers-$(uname -r)
|
||||
|
||||
#archive-managers
|
||||
sudo apt install -y zip gzip p7zip unace unrar unzip
|
||||
# Archive managers
|
||||
sudo apt install -y zip gzip p7zip unace unrar unzip file-roller
|
||||
|
||||
#fonts
|
||||
sudo apt install -y \
|
||||
font-manager \
|
||||
fonts-noto \
|
||||
fonts-dejavu \
|
||||
fonts-droid-fallback \
|
||||
fonts-hack \
|
||||
fonts-inconsolata \
|
||||
fonts-liberation \
|
||||
fonts-roboto \
|
||||
fonts-ubuntu \
|
||||
fonts-terminus
|
||||
# Fonts
|
||||
sudo apt install -y font-manager fonts-noto fonts-dejavu fonts-droid-fallback \
|
||||
fonts-hack fonts-inconsolata fonts-liberation fonts-roboto fonts-ubuntu fonts-terminus
|
||||
|
||||
# Install RobotoMono Nerd Font
|
||||
# Destination directory
|
||||
# RobotoMono Nerd Font
|
||||
FONT_DIR="$HOME/.local/share/fonts"
|
||||
mkdir -p "$FONT_DIR"
|
||||
|
||||
# Download RobotoMono Nerd Font (latest release)
|
||||
ZIP_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/RobotoMono.zip"
|
||||
TMP_DIR="$(mktemp -d)"
|
||||
|
||||
echo "Downloading RobotoMono Nerd Font..."
|
||||
curl -L "$ZIP_URL" -o "$TMP_DIR/RobotoMono.zip"
|
||||
|
||||
echo "Extracting..."
|
||||
unzip -q "$TMP_DIR/RobotoMono.zip" -d "$FONT_DIR"
|
||||
|
||||
echo "Cleaning up..."
|
||||
rm -rf "$TMP_DIR"
|
||||
|
||||
echo "Updating font cache..."
|
||||
fc-cache -fv
|
||||
|
||||
echo "RobotoMono Nerd Font installed successfully in $FONT_DIR"
|
||||
|
||||
#tools
|
||||
sudo apt install -y \
|
||||
wget \
|
||||
curl \
|
||||
nano \
|
||||
fastfetch \
|
||||
lolcat \
|
||||
bash-completion \
|
||||
starship \
|
||||
alacritty \
|
||||
hwinfo \
|
||||
lshw \
|
||||
libpam0g \
|
||||
libpam-modules \
|
||||
libpam-runtime \
|
||||
libpam-modules-bin \
|
||||
avahi-daemon \
|
||||
avahi-utils \
|
||||
libnss-mdns
|
||||
# Tools
|
||||
sudo apt install -y wget curl nano fastfetch lolcat bash-completion starship alacritty \
|
||||
hwinfo lshw libpam0g libpam-modules libpam-runtime libpam-modules-bin \
|
||||
avahi-daemon avahi-utils libnss-mdns man-db manpages tree xdg-user-dirs \
|
||||
mate-polkit rsync time bat chrony duf
|
||||
|
||||
if [ ! -f /usr/bin/duf ]; then
|
||||
sudo apt install -y duf
|
||||
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
|
||||
# Theming
|
||||
sudo apt install -y bibata-cursor-theme feh arc-theme
|
||||
|
||||
# Surfn icon theme
|
||||
echo "Installing Surfn icon theme..."
|
||||
# Clone Surfn repo
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
git clone https://github.com/erikdubois/Surfn.git "$TEMP_DIR/surfn"
|
||||
cd "$TEMP_DIR/surfn"
|
||||
# Copy the icon theme to the user's local icons directory
|
||||
cp -r surfn-icons/* ~/.icons/
|
||||
cd ~
|
||||
cp -r "$TEMP_DIR/surfn/surfn-icons/" ~/.icons/
|
||||
rm -rf "$TEMP_DIR"
|
||||
echo "Surfn icon theme installed."
|
||||
|
||||
# Flat Remix Dark GTK theme
|
||||
echo "Installing Flat Remix Dark GTK theme..."
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
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
|
||||
# Extract
|
||||
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/
|
||||
cd ~
|
||||
rm -rf "$TEMP_DIR"
|
||||
echo "Flat Remix Dark GTK theme installed."
|
||||
|
||||
#internet
|
||||
sudo apt install -y \
|
||||
chromium
|
||||
# Internet
|
||||
sudo apt install -y chromium
|
||||
|
||||
#enable services
|
||||
# Enable services
|
||||
sudo systemctl enable avahi-daemon.service
|
||||
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
|
||||
|
||||
echo
|
||||
tput setaf 3
|
||||
echo "########################################################################"
|
||||
##########################
|
||||
# Detect virtualization platform
|
||||
##########################
|
||||
echo "Detecting virtualization platform..."
|
||||
echo "########################################################################"
|
||||
tput sgr0
|
||||
echo
|
||||
|
||||
virt_type=$(systemd-detect-virt)
|
||||
|
||||
case "$virt_type" in
|
||||
@@ -226,40 +169,19 @@ read -n 1 -s -r -p "Press any key to continue"
|
||||
;;
|
||||
esac
|
||||
|
||||
# if on XFCE
|
||||
case "$DE" in
|
||||
xfce)
|
||||
#################################################################
|
||||
# Create directories (skel + user)
|
||||
#################################################################
|
||||
echo
|
||||
tput setaf 2
|
||||
echo "########################################################################"
|
||||
echo "################### Creating directories"
|
||||
echo "########################################################################"
|
||||
tput sgr0
|
||||
echo
|
||||
|
||||
##########################
|
||||
# XFCE-specific setup
|
||||
##########################
|
||||
if [[ "$DE" == "xfce" ]]; then
|
||||
echo "Setting up XFCE directories..."
|
||||
sudo mkdir -p /etc/skel/.config/xfce4/{panel,xfconf}
|
||||
mkdir -p \
|
||||
"$HOME/.config/"{xfce4,xfce4/xfconf}
|
||||
mkdir -p "$HOME/.config/"{xfce4,xfce4/xfconf}
|
||||
|
||||
# cleanup unwanted packages
|
||||
tput_yellow
|
||||
echo
|
||||
echo "Removing unwanted packages from $DE..."
|
||||
tput_reset
|
||||
|
||||
# Packages to remove
|
||||
# Cleanup unwanted packages
|
||||
echo "Removing unwanted packages from XFCE..."
|
||||
packages=("xfburn" "xfce4-screenshooter" "xfce4-notes")
|
||||
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
|
||||
if is_package_installed "$package"; then
|
||||
echo "Removing $package..."
|
||||
@@ -268,7 +190,6 @@ case "$DE" in
|
||||
echo "$package is not installed, skipping."
|
||||
fi
|
||||
|
||||
# Optional double-check
|
||||
if ! is_package_installed "$package"; then
|
||||
echo "$package successfully removed."
|
||||
else
|
||||
@@ -278,21 +199,8 @@ case "$DE" in
|
||||
echo "----------------------------"
|
||||
done
|
||||
|
||||
# Remove leftover dependencies
|
||||
sudo apt-get autoremove -y
|
||||
|
||||
# install needed packages
|
||||
#tools
|
||||
# Install XFCE tools
|
||||
sudo apt install -y thunar thunar-archive-plugin thunar-volman
|
||||
|
||||
#archive-managers
|
||||
sudo apt install -y file-roller
|
||||
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_blue() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -26,60 +36,49 @@ INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
##########################
|
||||
# 4. Desktop Environment installation
|
||||
##########################
|
||||
tput_yellow
|
||||
color_yellow
|
||||
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
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "No Desktop Environment detected. Installing KDE Plasma (light setup with SDDM)..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends sddm \
|
||||
plasma-desktop \
|
||||
dolphin \
|
||||
konsole \
|
||||
kate \
|
||||
plasma-nm \
|
||||
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
|
||||
plasma-desktop dolphin konsole kate \
|
||||
plasma-nm 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
|
||||
sudo systemctl enable sddm
|
||||
|
||||
# Enable graphical target
|
||||
sudo systemctl set-default graphical.target
|
||||
|
||||
# Rebuild Discover cache
|
||||
kbuildsycoca6
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "KDE Plasma with SDDM installed successfully."
|
||||
echo "You can reboot now to start KDE Plasma."
|
||||
tput_reset
|
||||
color_reset
|
||||
else
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "You already have $DE installed."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
# Check if LightDM is installed and active
|
||||
if systemctl is-active --quiet lightdm; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "LightDM is currently active. Replacing with SDDM..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
# Disable and remove LightDM
|
||||
sudo systemctl disable lightdm
|
||||
@@ -88,33 +87,30 @@ else
|
||||
# Install and enable SDDM
|
||||
sudo apt install -y sddm
|
||||
sudo systemctl enable sddm
|
||||
|
||||
# Enable graphical target
|
||||
sudo systemctl set-default graphical.target
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "LightDM removed and replaced with SDDM."
|
||||
tput_reset
|
||||
color_reset
|
||||
else
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "No LightDM detected, leaving current display manager unchanged."
|
||||
tput_reset
|
||||
color_reset
|
||||
fi
|
||||
fi
|
||||
|
||||
#cleanup unwanted packages
|
||||
# Packages to remove
|
||||
#packages=("vim" "vim-runtime" "vim-common" "vim-tiny" "mousepad" "parole")
|
||||
#sudo apt-mark manual xfce4-goodies
|
||||
##########################
|
||||
# Cleanup unwanted packages
|
||||
##########################
|
||||
# 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() {
|
||||
dpkg -s "$1" &> /dev/null
|
||||
}
|
||||
|
||||
# Iterate over each package
|
||||
for package in "${packages[@]}"; do
|
||||
if is_package_installed "$package"; then
|
||||
echo "Removing $package..."
|
||||
@@ -133,10 +129,11 @@ fi
|
||||
echo "----------------------------"
|
||||
done
|
||||
|
||||
# Resolving network issues
|
||||
##########################
|
||||
# Network cleanup
|
||||
##########################
|
||||
sudo mv /etc/network/interfaces /etc/network/interfaces.bak
|
||||
sudo systemctl restart NetworkManager
|
||||
|
||||
# Remove leftover dependencies
|
||||
sudo apt-get autoremove -y
|
||||
|
||||
|
||||
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_cyan() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
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
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
|
||||
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_cyan() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -23,5 +33,13 @@ DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
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
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
|
||||
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_blue() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -26,21 +36,19 @@ INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
##########################
|
||||
# 4. Desktop Environment installation
|
||||
##########################
|
||||
tput_yellow
|
||||
color_yellow
|
||||
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
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "No Desktop Environment detected. Installing XFCE (light setup with SDDM)..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends sddm \
|
||||
xfce4 \
|
||||
xfce4-goodies
|
||||
sudo apt install -y --no-install-recommends sddm xfce4 xfce4-goodies
|
||||
|
||||
# Enable SDDM as the display manager
|
||||
sudo systemctl enable sddm
|
||||
@@ -48,23 +56,23 @@ if [[ -z "$DDE" ]]; then
|
||||
# Enable graphical target
|
||||
sudo systemctl set-default graphical.target
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "XFCE with SDDM installed successfully."
|
||||
echo "You can reboot now to start XFCE."
|
||||
tput_reset
|
||||
color_reset
|
||||
else
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "You already have $DE installed."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
# Check if LightDM is installed and active
|
||||
if systemctl is-active --quiet lightdm; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "LightDM is currently active. Replacing with SDDM..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
# Disable and remove LightDM
|
||||
sudo systemctl disable lightdm
|
||||
@@ -74,14 +82,14 @@ else
|
||||
sudo apt install -y sddm
|
||||
sudo systemctl enable sddm
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "LightDM removed and replaced with SDDM."
|
||||
tput_reset
|
||||
color_reset
|
||||
else
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "No LightDM detected, leaving current display manager unchanged."
|
||||
tput_reset
|
||||
color_reset
|
||||
fi
|
||||
fi
|
||||
|
||||
186
v2/debian.sh
186
v2/debian.sh
@@ -2,17 +2,27 @@
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
tput_reset() { tput sgr0; }
|
||||
tput_black() { tput setaf 0; }
|
||||
tput_red() { tput setaf 1; }
|
||||
tput_green() { tput setaf 2; }
|
||||
tput_yellow() { tput setaf 3; }
|
||||
tput_cyan() { tput setaf 4; }
|
||||
tput_purple() { tput setaf 5; }
|
||||
tput_cyan() { tput setaf 6; }
|
||||
tput_gray() { tput setaf 7; }
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# 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
|
||||
@@ -23,10 +33,10 @@ DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "Starting Debian setup..."
|
||||
tput_reset
|
||||
color_reset
|
||||
echo
|
||||
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
|
||||
##########################
|
||||
if ! command -v curl >/dev/null 2>&1; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "curl is not installed. Installing..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt update
|
||||
sudo apt -y install curl
|
||||
fi
|
||||
@@ -45,24 +55,23 @@ fi
|
||||
##########################
|
||||
# 1. Add contrib and non-free if missing
|
||||
##########################
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
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 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 "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)
|
||||
DEBIAN_ORDER=(buster bullseye bookworm trixie)
|
||||
|
||||
# Function to get numeric index of codename
|
||||
codename_index() {
|
||||
local code="$1"
|
||||
for i in "${!DEBIAN_ORDER[@]}"; do
|
||||
@@ -75,80 +84,80 @@ CURRENT_INDEX=$(codename_index "$CURRENT_CODENAME")
|
||||
BULLSEYE_INDEX=$(codename_index "bullseye")
|
||||
|
||||
if [[ "$CURRENT_INDEX" -ge "$BULLSEYE_INDEX" ]] && grep -q "archive.debian.org" /etc/apt/sources.list; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
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
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "Updated sources.list to use deb.debian.org."
|
||||
tput_reset
|
||||
color_reset
|
||||
fi
|
||||
|
||||
##########################
|
||||
# 2. Full update and upgrade
|
||||
##########################
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Updating package lists..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt update
|
||||
|
||||
# Autoremove before full-upgrade
|
||||
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
|
||||
if [[ -n "$AUTOREMOVE_PENDING" ]]; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Removing packages that are no longer required before upgrade..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt -y autoremove
|
||||
fi
|
||||
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Upgrading installed packages..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt -y full-upgrade
|
||||
|
||||
# Autoremove after full-upgrade
|
||||
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
|
||||
if [[ -n "$AUTOREMOVE_PENDING" ]]; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Removing packages that are no longer required after upgrade..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt -y autoremove
|
||||
fi
|
||||
|
||||
UPGRADE_PENDING=$(apt list --upgradable 2>/dev/null | grep -v Listing || true)
|
||||
if [[ -n "$UPGRADE_PENDING" ]]; then
|
||||
tput_red
|
||||
color_red
|
||||
echo
|
||||
echo "Some packages were upgraded. A reboot is recommended before continuing."
|
||||
tput_reset
|
||||
color_reset
|
||||
read -rp "Reboot now? [y/N]: " reboot_choice
|
||||
case "${reboot_choice,,}" in
|
||||
y|yes)
|
||||
tput_red
|
||||
color_red
|
||||
echo
|
||||
echo "Rebooting now. After reboot, please restart this script to continue..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo reboot
|
||||
;;
|
||||
*)
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Skipping reboot. Make sure to reboot manually before continuing upgrades."
|
||||
tput_reset
|
||||
color_reset
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "All packages are up to date. Continuing to Debian major version check..."
|
||||
tput_reset
|
||||
color_reset
|
||||
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)
|
||||
LATEST_CODENAME=${DEBIAN_SEQUENCE[-1]}
|
||||
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "Current codename: $CURRENT_CODENAME"
|
||||
echo "Latest stable codename: $LATEST_CODENAME"
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
while [[ "$CURRENT_CODENAME" != "$LATEST_CODENAME" ]]; do
|
||||
NEXT_CODENAME=""
|
||||
@@ -174,66 +183,64 @@ while [[ "$CURRENT_CODENAME" != "$LATEST_CODENAME" ]]; do
|
||||
done
|
||||
|
||||
if [[ -z "$NEXT_CODENAME" ]]; then
|
||||
tput_red
|
||||
color_red
|
||||
echo
|
||||
echo "Error: Cannot determine next codename after $CURRENT_CODENAME"
|
||||
tput_reset
|
||||
color_reset
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
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
|
||||
case "${choice,,}" in
|
||||
y|yes)
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
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
|
||||
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Updating packages..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt update
|
||||
|
||||
# Autoremove before full-upgrade
|
||||
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
|
||||
if [[ -n "$AUTOREMOVE_PENDING" ]]; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Removing packages that are no longer required before upgrade..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt -y autoremove
|
||||
fi
|
||||
|
||||
sudo apt -y full-upgrade
|
||||
|
||||
# Autoremove after full-upgrade
|
||||
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
|
||||
if [[ -n "$AUTOREMOVE_PENDING" ]]; then
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Removing packages that are no longer required after upgrade..."
|
||||
tput_reset
|
||||
color_reset
|
||||
sudo apt -y autoremove
|
||||
fi
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "Upgrade to $NEXT_CODENAME complete. A reboot is recommended."
|
||||
tput_reset
|
||||
color_reset
|
||||
read -rp "Press Enter to reboot..." _
|
||||
sudo reboot
|
||||
;;
|
||||
*)
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Skipping upgrade to $NEXT_CODENAME. Continuing with current version."
|
||||
tput_reset
|
||||
color_reset
|
||||
break
|
||||
;;
|
||||
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)
|
||||
done
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "Debian is now at codename $CURRENT_CODENAME. Continuing with DE/TWM installation..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
##########################
|
||||
# 4. Desktop Environment installation
|
||||
##########################
|
||||
case "$DE" in
|
||||
xfce|plasma|gnome)
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Preparing to install $DE..."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
# Run DE-specific script dynamically
|
||||
SCRIPT_NAME="${OS}-${DE}.sh"
|
||||
if [[ -f "$SCRIPT_NAME" ]]; then
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "Running $SCRIPT_NAME..."
|
||||
tput_reset
|
||||
color_reset
|
||||
bash "$SCRIPT_NAME"
|
||||
else
|
||||
tput_red
|
||||
color_red
|
||||
echo
|
||||
echo "Error: $SCRIPT_NAME not found!"
|
||||
tput_reset
|
||||
color_reset
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
none)
|
||||
tput_gray
|
||||
color_gray
|
||||
echo
|
||||
echo "No Desktop Environment selected, skipping DE installation."
|
||||
tput_reset
|
||||
color_reset
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -285,32 +291,31 @@ esac
|
||||
##########################
|
||||
case "$TWM" in
|
||||
chadwm|hyprland)
|
||||
tput_yellow
|
||||
color_yellow
|
||||
echo
|
||||
echo "Installing CHADWM..."
|
||||
tput_reset
|
||||
echo "Installing $TWM..."
|
||||
color_reset
|
||||
|
||||
# Run TWM-specific script dynamically
|
||||
SCRIPT_NAME="${OS}-${TWM}.sh"
|
||||
if [[ -f "$SCRIPT_NAME" ]]; then
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "Running $SCRIPT_NAME..."
|
||||
tput_reset
|
||||
color_reset
|
||||
bash "$SCRIPT_NAME"
|
||||
else
|
||||
tput_red
|
||||
color_red
|
||||
echo
|
||||
echo "Error: $SCRIPT_NAME not found!"
|
||||
tput_reset
|
||||
color_reset
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
none)
|
||||
tput_gray
|
||||
color_gray
|
||||
echo
|
||||
echo "No tiling window manager selected."
|
||||
tput_reset
|
||||
color_reset
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -319,30 +324,29 @@ esac
|
||||
##########################
|
||||
case "$INSTALL_LEVEL" in
|
||||
minimal|full|workstation|server)
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "Minimal installation selected."
|
||||
tput_reset
|
||||
echo "Installation level: $INSTALL_LEVEL"
|
||||
color_reset
|
||||
|
||||
# Run Installation Level-specific script dynamically
|
||||
SCRIPT_NAME="${OS}-${INSTALL_LEVEL}.sh"
|
||||
if [[ -f "$SCRIPT_NAME" ]]; then
|
||||
tput_cyan
|
||||
color_cyan
|
||||
echo
|
||||
echo "Running $SCRIPT_NAME..."
|
||||
tput_reset
|
||||
color_reset
|
||||
bash "$SCRIPT_NAME"
|
||||
else
|
||||
tput_red
|
||||
color_red
|
||||
echo
|
||||
echo "Error: $SCRIPT_NAME not found!"
|
||||
tput_reset
|
||||
color_reset
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
tput_green
|
||||
color_green
|
||||
echo
|
||||
echo "Debian setup complete."
|
||||
tput_reset
|
||||
color_reset
|
||||
|
||||
Reference in New Issue
Block a user