v3_reorder files
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE:-}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
echo
|
||||
say_cyan "Starting Debian Chadwm setup..."
|
||||
say_cyan "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
|
||||
echo
|
||||
|
||||
# End of script
|
||||
say_green "Chadwm setup completed."
|
||||
|
||||
# Pause
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE:-}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
|
||||
say_yellow "Starting full setup..."
|
||||
|
||||
# Run minimal first
|
||||
bash "$SCRIPT_DIR/debian-minimal.sh"
|
||||
|
||||
# Add extra packages
|
||||
install_packages arandr catfish galculator network-manager network-manager-applet network-manager-openvpn numlockx pulseaudio pavucontrol playerctl gparted xfce4-indicator-plugin xfce4-pulseaudio-plugin xfce4-clipman-plugin
|
||||
|
||||
# Ensure NetworkManager manages all interfaces
|
||||
echo "Setting NetworkManager to manage all interfaces..."
|
||||
sudo cp /etc/network/interfaces /etc/network/interfaces.bak.$(date +%s)
|
||||
sudo tee /etc/network/interfaces > /dev/null <<'EOF'
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
EOF
|
||||
sudo sed -i 's/^managed=.*/managed=true/' /etc/NetworkManager/NetworkManager.conf || \
|
||||
echo -e "[ifupdown]\nmanaged=true" | sudo tee -a /etc/NetworkManager/NetworkManager.conf
|
||||
sudo systemctl restart NetworkManager
|
||||
|
||||
########################################
|
||||
# XFCE-specific configuration
|
||||
########################################
|
||||
if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then
|
||||
echo
|
||||
say_cyan "Applying XFCE defaults: fonts, browser, and terminal..."
|
||||
|
||||
# Ensure xfconf-query exists (for XFCE settings)
|
||||
if ! command -v xfconf-query >/dev/null 2>&1; then
|
||||
say_yellow "xfconf-query not found — installing xfce4-settings..."
|
||||
install_packages xfce4-settings
|
||||
fi
|
||||
|
||||
# set fonts
|
||||
# Wait for xfconf to be available (only needed if running inside the same session)
|
||||
if command -v xfconf-query >/dev/null 2>&1; then
|
||||
# Interface font (UI)
|
||||
xfconf-query -c xsettings -p /Gtk/FontName -s "RobotoMono Nerd Font Regular 10"
|
||||
# Monospace font (terminals, editors)
|
||||
xfconf-query -c xsettings -p /Gtk/MonospaceFontName -s "RobotoMono Nerd Font Mono Regular 10"
|
||||
|
||||
say_green "XFCE fonts updated successfully!"
|
||||
else
|
||||
say_yellow "xfconf-query not found — skipping XFCE font config (will apply at first login)."
|
||||
fi
|
||||
|
||||
# Set browser default
|
||||
if command -v chromium >/dev/null 2>&1; then
|
||||
mkdir -p "$HOME/.config/xfce4/"
|
||||
HELPERS_FILE="$HOME/.config/xfce4/helpers.rc"
|
||||
|
||||
# Ensure the helpers file exists
|
||||
touch "$HELPERS_FILE"
|
||||
|
||||
# Update or insert browser entry
|
||||
if grep -q '^WebBrowser=' "$HELPERS_FILE"; then
|
||||
sed -i 's|^WebBrowser=.*|WebBrowser=chromium|' "$HELPERS_FILE"
|
||||
else
|
||||
echo "WebBrowser=chromium" >> "$HELPERS_FILE"
|
||||
fi
|
||||
say_green "XFCE defeault browser set to chromium!"
|
||||
fi
|
||||
|
||||
# Set default terminal
|
||||
if command -v alacritty >/dev/null 2>&1; then
|
||||
mkdir -p "$HOME/.config/xfce4/"
|
||||
HELPERS_FILE="$HOME/.config/xfce4/helpers.rc"
|
||||
|
||||
touch "$HELPERS_FILE"
|
||||
|
||||
# TerminalEmulator entry
|
||||
if grep -q '^TerminalEmulator=' "$HELPERS_FILE"; then
|
||||
sed -i 's|^TerminalEmulator=.*|TerminalEmulator=alacritty|' "$HELPERS_FILE"
|
||||
else
|
||||
echo "TerminalEmulator=alacritty" >> "$HELPERS_FILE"
|
||||
fi
|
||||
|
||||
# TerminalEmulatorCommand entry
|
||||
if grep -q '^TerminalEmulatorCommand=' "$HELPERS_FILE"; then
|
||||
sed -i 's|^TerminalEmulatorCommand=.*|TerminalEmulatorCommand=alacritty|' "$HELPERS_FILE"
|
||||
else
|
||||
echo "TerminalEmulatorCommand=alacritty" >> "$HELPERS_FILE"
|
||||
fi
|
||||
say_green "XFCE defeault terminal set to alacritty!"
|
||||
fi
|
||||
fi
|
||||
|
||||
###############################################
|
||||
# Copy settings to HOME
|
||||
###############################################
|
||||
SOURCE_DIR="$SCRIPT_DIR/config-files/debian"
|
||||
DEST_DIR="$HOME"
|
||||
AUTOSTART_DIR="$HOME/.config/autostart"
|
||||
AUTOSTART_FILE="$AUTOSTART_DIR/xfce-config-apply.desktop"
|
||||
HELPER_SCRIPT="$HOME/.local/bin/xfce-config-apply-helper.sh"
|
||||
|
||||
mkdir -p "$AUTOSTART_DIR" "$HOME/.local/bin"
|
||||
|
||||
# 1. Verify source directory exists
|
||||
if [ ! -d "$SOURCE_DIR" ]; then
|
||||
say_red "Error: Source directory '$SOURCE_DIR' not found. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 2. Create helper script
|
||||
cat > "$HELPER_SCRIPT" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
RED="\033[0;31m"; GREEN="\033[0;32m"; YELLOW="\033[0;33m"; CYAN="\033[0;36m"; RESET="\033[0m"
|
||||
say() { printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
|
||||
SOURCE_DIR="$HOME/config-files/debian"
|
||||
DEST_DIR="$HOME"
|
||||
|
||||
if [ ! -d "\$SOURCE_DIR" ]; then
|
||||
say "Source directory \$SOURCE_DIR not found; skipping."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
say "Applying XFCE configuration early in session..."
|
||||
shopt -s dotglob
|
||||
cp -vrf "\$SOURCE_DIR"/* "\$DEST_DIR"/
|
||||
shopt -u dotglob
|
||||
|
||||
say "Clearing session cache..."
|
||||
rm -rf "\$HOME/.cache/sessions/"
|
||||
|
||||
say "Configuration applied. Removing one-time autostart entry..."
|
||||
rm -f "\$HOME/.config/autostart/xfce-config-apply.desktop"
|
||||
exit 0
|
||||
EOF
|
||||
|
||||
chmod +x "$HELPER_SCRIPT"
|
||||
|
||||
# 3. Create autostart entry (early-phase)
|
||||
cat > "$AUTOSTART_FILE" <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Apply XFCE Config (Early)
|
||||
Comment=One-time XFCE configuration importer
|
||||
Exec=$HELPER_SCRIPT
|
||||
OnlyShowIn=XFCE;
|
||||
X-GNOME-Autostart-enabled=true
|
||||
X-XFCE-Autostart-Phase=Initialization
|
||||
Hidden=false
|
||||
NoDisplay=false
|
||||
EOF
|
||||
|
||||
# Secure permissions for autostart file and directories
|
||||
chmod 700 "$HOME/.config" "$HOME/.config/autostart"
|
||||
chmod 700 "$AUTOSTART_FILE"
|
||||
chmod +x "$AUTOSTART_FILE"
|
||||
|
||||
say_yellow "XFCE configuration will be applied at next login."
|
||||
say_cyan "Autostart created at: $AUTOSTART_FILE"
|
||||
say_cyan "Helper script: $HELPER_SCRIPT"
|
||||
|
||||
|
||||
# End of script
|
||||
say_green "Full setup completed."
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE:-}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
detect_de() { command -v gnome-session >/dev/null 2>&1 && echo "gnome" || echo ""; }
|
||||
detect_display_manager() { [ -f /etc/X11/default-display-manager ] && basename "$(cat /etc/X11/default-display-manager)" || echo ""; }
|
||||
enable_graphical_target() { sudo systemctl enable sddm; sudo systemctl set-default graphical.target; }
|
||||
|
||||
say_yellow "Starting Gnome installation..."
|
||||
|
||||
CURRENT_DE="$(detect_de)"
|
||||
CURRENT_DM="$(detect_display_manager)"
|
||||
|
||||
if [[ -z "$CURRENT_DE" ]]; then
|
||||
say_cyan "No DE detected. Installing Gnome with SDDM..."
|
||||
install_packages sddm gnome-shell gnome-terminal nautilus gnome-control-center gnome-system-monitor gnome-tweaks network-manager-gnome gnome-keyring gnome-session
|
||||
enable_graphical_target
|
||||
say_green "Gnome with SDDM installed successfully."
|
||||
else
|
||||
say_cyan "Detected existing DE: $CURRENT_DE"
|
||||
if [[ "$CURRENT_DM" == "lightdm" ]]; then
|
||||
say_yellow "Replacing LightDM with SDDM..."
|
||||
sudo systemctl disable lightdm
|
||||
sudo apt purge -y lightdm lightdm-gtk-greeter
|
||||
install_packages sddm
|
||||
enable_graphical_target
|
||||
say_green "LightDM replaced with SDDM."
|
||||
else
|
||||
say_cyan "Current DM: ${CURRENT_DM:-none}, leaving unchanged."
|
||||
fi
|
||||
fi
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
|
||||
say_yellow "Starting hyprland setup..."
|
||||
|
||||
# Optionally add hyprland-specific packages here
|
||||
#install_packages ????
|
||||
|
||||
# End of script
|
||||
say_green "hyprland setup completed."
|
||||
|
||||
# Pause
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
|
||||
say_yellow "Starting minimal setup..."
|
||||
|
||||
# Create user directories
|
||||
mkdir -p "$HOME"/{.bin,.fonts,.icons,.themes,DATA} "$HOME/.local/share/"{icons,themes,applications} "$HOME/.config/"{autostart,gtk-{3.0,4.0},variety,fish,neofetch}
|
||||
|
||||
# Install essential tools
|
||||
install_packages wget curl nano fastfetch lolcat bash-completion starship alacritty hwinfo lshw man-db tree xdg-user-dirs rsync time bat chrony unzip chromium
|
||||
|
||||
# Optionally handle fonts
|
||||
FONT_DIR="$HOME/.local/share/fonts"
|
||||
FONT_NAME="RobotoMonoNerdFont" # Changed name to reflect the installed files
|
||||
FONT_ZIP="/tmp/RobotoMono.zip" # Use original ZIP name for download
|
||||
DOWNLOAD_NAME="RobotoMono"
|
||||
if ! find "$FONT_DIR" -name "${FONT_NAME}*.ttf" -print -quit 2>/dev/null; then
|
||||
say_yellow "Installing ${DOWNLOAD_NAME} Nerd Font..."
|
||||
mkdir -p "$FONT_DIR"
|
||||
curl -L "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/${DOWNLOAD_NAME}.zip" -o "$FONT_ZIP"
|
||||
unzip -oq "$FONT_ZIP" -d "$FONT_DIR"
|
||||
fc-cache -fv
|
||||
rm "$FONT_ZIP"
|
||||
say_green "${DOWNLOAD_NAME} installed."
|
||||
else
|
||||
say_yellow "${DOWNLOAD_NAME} Nerd Font is already installed in $FONT_DIR. Skipping installation."
|
||||
fi
|
||||
|
||||
# Enable basic services
|
||||
sudo systemctl enable chrony
|
||||
sudo systemctl enable fstrim.timer
|
||||
|
||||
# End of script
|
||||
say_green "Minimal setup completed."
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
detect_de() { command -v startplasma-x11 >/dev/null 2>&1 && echo "plasma" || echo ""; }
|
||||
detect_display_manager() { [ -f /etc/X11/default-display-manager ] && basename "$(cat /etc/X11/default-display-manager)" || echo ""; }
|
||||
enable_graphical_target() { sudo systemctl enable sddm; sudo systemctl set-default graphical.target; }
|
||||
|
||||
##########################
|
||||
# Install Plasma
|
||||
##########################
|
||||
say_yellow "Starting KDE Plasma installation..."
|
||||
|
||||
CURRENT_DE="$(detect_de)"
|
||||
CURRENT_DM="$(detect_display_manager)"
|
||||
|
||||
if [[ -z "$CURRENT_DE" ]]; then
|
||||
say_cyan "No DE detected. Installing KDE Plasma with SDDM..."
|
||||
install_packages sddm plasma-desktop dolphin konsole kate plasma-nm plasma-workspace kde-config-gtk-style kde-config-sddm plasma-discover kscreen
|
||||
enable_graphical_target
|
||||
say_green "KDE Plasma with SDDM installed successfully."
|
||||
else
|
||||
say_cyan "Detected existing DE: $CURRENT_DE"
|
||||
if [[ "$CURRENT_DM" == "lightdm" ]]; then
|
||||
colosay_yellow "Replacing LightDM with SDDM..."
|
||||
sudo systemctl disable lightdm
|
||||
sudo apt purge -y lightdm lightdm-gtk-greeter
|
||||
install_packages sddm
|
||||
enable_graphical_target
|
||||
say_green "LightDM replaced with SDDM."
|
||||
else
|
||||
say_cyan "Current DM: ${CURRENT_DM:-none}, leaving unchanged."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Pause
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
|
||||
say_yellow "Starting Server setup..."
|
||||
|
||||
# Optionally add Server-specific packages here
|
||||
install_packages linux-headers-$(uname -r)
|
||||
|
||||
# End of script
|
||||
say_green "Server setup completed."
|
||||
|
||||
# Pause
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
|
||||
say_yellow "Starting workstation setup..."
|
||||
|
||||
# Run full setup first
|
||||
bash "$SCRIPT_DIR/debian-full.sh"
|
||||
|
||||
# Optionally add workstation-specific packages here
|
||||
install_packages git vlc libreoffice
|
||||
|
||||
# End of script
|
||||
say_green "Workstation setup completed."
|
||||
|
||||
# Pause
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
echo
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() {
|
||||
local packages=("$@")
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends "${packages[@]}"
|
||||
}
|
||||
|
||||
is_package_installed() {
|
||||
dpkg -s "$1" &>/dev/null
|
||||
}
|
||||
|
||||
detect_de() {
|
||||
if command -v xfce4-session >/dev/null 2>&1; then
|
||||
echo "xfce"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
detect_display_manager() {
|
||||
if [ -f /etc/X11/default-display-manager ]; then
|
||||
basename "$(cat /etc/X11/default-display-manager)"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
enable_graphical_target() {
|
||||
sudo systemctl enable sddm
|
||||
sudo systemctl set-default graphical.target
|
||||
}
|
||||
|
||||
##########################
|
||||
# Start installation
|
||||
##########################
|
||||
say_yellow -e "Starting XFCE installation..."
|
||||
|
||||
CURRENT_DE="$(detect_de)"
|
||||
CURRENT_DM="$(detect_display_manager)"
|
||||
|
||||
if [[ -z "$CURRENT_DE" ]]; then
|
||||
say_cyan -e "No Desktop Environment detected. Installing XFCE (light setup with SDDM)..."
|
||||
|
||||
install_packages sddm xfce4 xfce4-goodies
|
||||
enable_graphical_target
|
||||
|
||||
say_green -e "XFCE with SDDM installed successfully. You can reboot now to start XFCE."
|
||||
else
|
||||
say_cyan -e "Detected existing Desktop Environment: $CURRENT_DE"
|
||||
|
||||
if [[ "$CURRENT_DM" == "lightdm" ]]; then
|
||||
say_yellow -e "LightDM is currently active. Replacing with SDDM..."
|
||||
|
||||
sudo systemctl disable lightdm
|
||||
sudo pacman -Rns lightdm lightdm-gtk-greeter
|
||||
|
||||
install_packages sddm
|
||||
enable_graphical_target
|
||||
|
||||
say_green -e "LightDM removed and replaced with SDDM."
|
||||
else
|
||||
say_cyan -e "Current display manager: ${CURRENT_DM:-none}. Leaving unchanged."
|
||||
fi
|
||||
fi
|
||||
|
||||
# End of script
|
||||
say_green -e "XFCE / SDDM setup completed."
|
||||
+247
@@ -0,0 +1,247 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
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
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
echo
|
||||
say_cyan "Starting Debian setup..."
|
||||
echo
|
||||
say_gray "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
|
||||
|
||||
##########################
|
||||
# 0. Ensure curl is installed
|
||||
##########################
|
||||
if ! command -v curl >/dev/null 2>&1; then
|
||||
say_yellow "curl is not installed. Installing..."
|
||||
sudo apt update
|
||||
sudo apt -y install curl
|
||||
fi
|
||||
|
||||
##########################
|
||||
# 1. Add contrib and non-free if missing
|
||||
##########################
|
||||
say_yellow "Checking /etc/apt/sources.list for contrib/non-free..."
|
||||
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
|
||||
say_green "Updated sources.list to include contrib/non-free where needed."
|
||||
|
||||
##########################
|
||||
# 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)
|
||||
|
||||
codename_index() {
|
||||
local code="$1"
|
||||
for i in "${!DEBIAN_ORDER[@]}"; do
|
||||
[[ "${DEBIAN_ORDER[$i]}" == "$code" ]] && echo "$i" && return
|
||||
done
|
||||
echo -1
|
||||
}
|
||||
|
||||
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
|
||||
say_yellow "Found archive.debian.org in sources.list and system is Bullseye or newer, updating to deb.debian.org..."
|
||||
sudo sed -i -r 's|archive\.debian\.org|deb.debian.org|g' /etc/apt/sources.list
|
||||
say_green "Updated sources.list to use deb.debian.org."
|
||||
fi
|
||||
|
||||
##########################
|
||||
# 2. Full update and upgrade
|
||||
##########################
|
||||
say_yellow "Updating package lists..."
|
||||
sudo apt update
|
||||
|
||||
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
|
||||
if [[ -n "$AUTOREMOVE_PENDING" ]]; then
|
||||
say_yellow "Removing packages that are no longer required before upgrade..."
|
||||
sudo apt -y autoremove
|
||||
fi
|
||||
|
||||
say_yellow "Upgrading installed packages..."
|
||||
sudo apt -y full-upgrade
|
||||
|
||||
AUTOREMOVE_PENDING=$(apt -s autoremove | grep -E 'Remv' || true)
|
||||
if [[ -n "$AUTOREMOVE_PENDING" ]]; then
|
||||
say_yellow "Removing packages that are no longer required after upgrade..."
|
||||
sudo apt -y autoremove
|
||||
fi
|
||||
|
||||
UPGRADE_PENDING=$(apt list --upgradable 2>/dev/null | grep -v Listing || true)
|
||||
if [[ -n "$UPGRADE_PENDING" ]]; then
|
||||
say_red "Some packages were upgraded. A reboot is recommended before continuing."
|
||||
read -rp "Reboot now? [y/N]: " reboot_choice
|
||||
case "${reboot_choice,,}" in
|
||||
y|yes)
|
||||
say_red "Rebooting now. After reboot, please restart this script to continue..."
|
||||
sudo reboot
|
||||
;;
|
||||
*)
|
||||
say_yellow "Skipping reboot. Make sure to reboot manually before continuing upgrades."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
say_green "All packages are up to date. Continuing to Debian major version check..."
|
||||
fi
|
||||
|
||||
##########################
|
||||
# 3. Stepwise major version upgrade
|
||||
##########################
|
||||
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]}
|
||||
|
||||
say_cyan "Current codename: $CURRENT_CODENAME"
|
||||
say_cyan "Latest stable codename: $LATEST_CODENAME"
|
||||
|
||||
while [[ "$CURRENT_CODENAME" != "$LATEST_CODENAME" ]]; do
|
||||
NEXT_CODENAME=""
|
||||
for i in "${!DEBIAN_SEQUENCE[@]}"; do
|
||||
if [[ "${DEBIAN_SEQUENCE[$i]}" == "$CURRENT_CODENAME" ]]; then
|
||||
NEXT_CODENAME="${DEBIAN_SEQUENCE[$((i+1))]}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z "$NEXT_CODENAME" ]]; then
|
||||
say_red "Error: Cannot determine next codename after $CURRENT_CODENAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
say_yellow "Detected codename $CURRENT_CODENAME, next stable version: $NEXT_CODENAME"
|
||||
read -rp "Do you want to upgrade to $NEXT_CODENAME? [y/N]: " choice
|
||||
case "${choice,,}" in
|
||||
y|yes)
|
||||
say_yellow "Updating sources.list to $NEXT_CODENAME..."
|
||||
sudo sed -i -r "s/\b$CURRENT_CODENAME\b/$NEXT_CODENAME/g" /etc/apt/sources.list
|
||||
|
||||
say_yellow "Updating packages..."
|
||||
sudo apt update
|
||||
sudo apt -y autoremove || true
|
||||
sudo apt -y full-upgrade
|
||||
sudo apt -y autoremove || true
|
||||
|
||||
say_green "Upgrade to $NEXT_CODENAME complete. A reboot is recommended."
|
||||
read -rp "Press Enter to reboot..." _
|
||||
sudo reboot
|
||||
;;
|
||||
*)
|
||||
say_yellow "Skipping upgrade to $NEXT_CODENAME. Continuing with current version."
|
||||
break
|
||||
;;
|
||||
esac
|
||||
|
||||
CURRENT_CODENAME=$(grep -Po 'deb\s+\S+\s+\K\S+' /etc/apt/sources.list | grep -E '^(buster|bullseye|bookworm|trixie)$' | head -n1)
|
||||
done
|
||||
|
||||
say_green "Debian is now at codename $CURRENT_CODENAME. Continuing with DE/TWM installation..."
|
||||
|
||||
##########################
|
||||
# 4. Desktop Environment installation
|
||||
##########################
|
||||
case "$DE" in
|
||||
xfce|plasma|gnome)
|
||||
say_yellow "Preparing to install $DE..."
|
||||
SCRIPT_NAME="$SCRIPT_DIR/${OS}-${DE}.sh"
|
||||
if [[ -f "$SCRIPT_NAME" ]]; then
|
||||
say_cyan "Running $SCRIPT_NAME..."
|
||||
bash "$SCRIPT_NAME"
|
||||
else
|
||||
say_red "Error: $SCRIPT_NAME not found!"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
none)
|
||||
say_gray "No Desktop Environment selected, skipping DE installation."
|
||||
;;
|
||||
esac
|
||||
|
||||
##########################
|
||||
# 5. Tiling Window Manager installation
|
||||
##########################
|
||||
case "$TWM" in
|
||||
chadwm|hyprland)
|
||||
say_yellow "Installing $TWM..."
|
||||
SCRIPT_NAME="$SCRIPT_DIR/${OS}-${TWM}.sh"
|
||||
if [[ -f "$SCRIPT_NAME" ]]; then
|
||||
say_cyan "Running $SCRIPT_NAME..."
|
||||
bash "$SCRIPT_NAME"
|
||||
else
|
||||
say_red "Error: $SCRIPT_NAME not found!"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
none)
|
||||
say_gray "No tiling window manager selected."
|
||||
;;
|
||||
esac
|
||||
|
||||
##########################
|
||||
# 6. Installation level handling
|
||||
##########################
|
||||
case "$INSTALL_LEVEL" in
|
||||
minimal|full|workstation|server)
|
||||
say_cyan "Installation level: $INSTALL_LEVEL"
|
||||
SCRIPT_NAME="$SCRIPT_DIR/${OS}-${INSTALL_LEVEL}.sh"
|
||||
if [[ -f "$SCRIPT_NAME" ]]; then
|
||||
say_cyan "Running $SCRIPT_NAME..."
|
||||
bash "$SCRIPT_NAME"
|
||||
else
|
||||
say_red "Error: $SCRIPT_NAME not found!"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
say_green "Debian setup complete."
|
||||
say_red "The installation has finished. A reboot is recommended."
|
||||
# Reboots are dangerous to automate; we use a shorter timeout and default to No
|
||||
if read -t 10 -rp "Reboot now? [y/N]: " reboot_choice; then
|
||||
case "${reboot_choice,,}" in
|
||||
y|yes)
|
||||
say_red "Rebooting now."
|
||||
sudo reboot
|
||||
;;
|
||||
*)
|
||||
say_yellow "Skipping reboot."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
else
|
||||
say_yellow "\nNo input detected. Skipping reboot for safety."
|
||||
exit 0
|
||||
fi
|
||||
Reference in New Issue
Block a user