CLEANUP v1

This commit is contained in:
[yuri]
2025-11-10 09:37:46 +01:00
commit 281fb06382
46 changed files with 5559 additions and 0 deletions

142
v2/debian-plasma.sh Executable file
View File

@@ -0,0 +1,142 @@
#!/bin/bash
set -euo pipefail
##########################
# Color helpers
##########################
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; }
##########################
# 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}"
##########################
# 4. Desktop Environment installation
##########################
tput_yellow
echo "Installing KDE Plasma..."
tput_reset
#detect if KDE Plasma and SDDM are installed and if not install them
if [[ -z "$DDE" ]]; then
tput_cyan
echo
echo "No Desktop Environment detected. Installing KDE Plasma (light setup with SDDM)..."
tput_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
# 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
echo
echo "KDE Plasma with SDDM installed successfully."
echo "You can reboot now to start KDE Plasma."
tput_reset
else
tput_cyan
echo
echo "You already have $DE installed."
tput_reset
# Check if LightDM is installed and active
if systemctl is-active --quiet lightdm; then
tput_yellow
echo
echo "LightDM is currently active. Replacing with SDDM..."
tput_reset
# Disable and remove LightDM
sudo systemctl disable lightdm
sudo apt purge -y lightdm lightdm-gtk-greeter
# Install and enable SDDM
sudo apt install -y sddm
sudo systemctl enable sddm
# Enable graphical target
sudo systemctl set-default graphical.target
tput_green
echo
echo "LightDM removed and replaced with SDDM."
tput_reset
else
tput_cyan
echo
echo "No LightDM detected, leaving current display manager unchanged."
tput_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
# 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..."
sudo apt-get purge -y "$package"
else
echo "$package is not installed, skipping."
fi
# Optional double-check
if ! is_package_installed "$package"; then
echo "$package successfully removed."
else
echo "$package is still installed. Check manually."
fi
echo "----------------------------"
done
# Resolving network issues
sudo mv /etc/network/interfaces /etc/network/interfaces.bak
sudo systemctl restart NetworkManager
# Remove leftover dependencies
sudo apt-get autoremove -y