v3_reorder files
This commit is contained in:
Executable
+146
@@ -0,0 +1,146 @@
|
||||
#!/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}"
|
||||
TWM="${SELECTED_TWM}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
detect_de() {
|
||||
if command -v xfce4-session >/dev/null 2>&1; then
|
||||
echo "xfce"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
detect_display_manager() {
|
||||
if [ -f /etc/systemd/system/display-manager.service ]; then
|
||||
basename "$(readlink /etc/systemd/system/display-manager.service)"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
enable_graphical_target() {
|
||||
sudo systemctl enable sddm
|
||||
sudo systemctl set-default graphical.target
|
||||
}
|
||||
|
||||
#########################
|
||||
# Start installation
|
||||
##########################
|
||||
say_yellow "Starting Chadwm setup..."
|
||||
|
||||
# 1. FIX: Identify the correct user correctly
|
||||
# If running via sudo, we want the actual user, not root.
|
||||
ACTUAL_USER=${SUDO_USER:-$(whoami)}
|
||||
|
||||
# 2. LOGIC FIX:
|
||||
# If you want Chadwm to install even if XFCE is present,
|
||||
# we should check if Chadwm is already installed instead of checking for a DE.
|
||||
if [ ! -f "/usr/local/bin/chadwm" ]; then
|
||||
say_cyan "Installing Chadwm..."
|
||||
|
||||
install_packages sddm picom feh acpi rofi dash imlib2 xsetroot git base-devel
|
||||
enable_graphical_target
|
||||
|
||||
# Use absolute path to avoid home directory confusion
|
||||
USER_HOME="/home/$ACTUAL_USER"
|
||||
CHAD_DIR="$USER_HOME/.config/chadwm"
|
||||
|
||||
# Clone as the actual user so permissions are correct
|
||||
if [ ! -d "$CHAD_DIR" ]; then
|
||||
sudo -u "$ACTUAL_USER" git clone https://github.com/siduck/chadwm --depth 1 "$CHAD_DIR"
|
||||
fi
|
||||
|
||||
# Move to the source directory and build
|
||||
cd "$CHAD_DIR/chadwm"
|
||||
sudo make install
|
||||
|
||||
# 3. Ensure the target directory actually exists
|
||||
TARGET_DIR="/usr/share/xsessions"
|
||||
TARGET_FILE="$TARGET_DIR/chadwm.desktop"
|
||||
|
||||
sudo mkdir -p "$TARGET_DIR"
|
||||
|
||||
# 4. Create the .desktop file
|
||||
# Use the ACTUAL_USER variable here
|
||||
cat <<EOF | sudo tee $TARGET_FILE > /dev/null
|
||||
[Desktop Entry]
|
||||
Name=chadwm
|
||||
Comment=dwm made beautiful
|
||||
Exec=$CHAD_DIR/scripts/run.sh
|
||||
Type=Application
|
||||
EOF
|
||||
|
||||
sudo chmod 644 $TARGET_FILE
|
||||
say_green "Chadwm with SDDM installed successfully."
|
||||
else
|
||||
say_cyan "Chadwm binary already detected. Skipping build."
|
||||
fi
|
||||
|
||||
# 5. Handle Display Manager replacement separately
|
||||
CURRENT_DM="$(detect_display_manager)"
|
||||
if [[ "$CURRENT_DM" == "lightdm.service" ]]; then
|
||||
say_yellow "LightDM is active. Switching to SDDM..."
|
||||
sudo systemctl disable lightdm
|
||||
sudo pacman -Rs --noconfirm lightdm lightdm-gtk-greeter || true
|
||||
sudo systemctl enable sddm
|
||||
fi
|
||||
|
||||
say_green "Chadwm / SDDM setup completed."
|
||||
Executable
+162
@@ -0,0 +1,162 @@
|
||||
#!/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() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
say_yellow "Starting full setup..."
|
||||
|
||||
# Run minimal first
|
||||
bash "$SCRIPT_DIR/arch-minimal.sh"
|
||||
|
||||
# Add extra packages
|
||||
install_packages arandr catfish galculator networkmanager network-manager-applet networkmanager-openvpn numlockx pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol playerctl gparted xfce4-indicator-plugin xfce4-pulseaudio-plugin xfce4-clipman-plugin
|
||||
|
||||
# Ensure NetworkManager manages all interfaces
|
||||
say_yellow "Ensuring NetworkManager service is enabled and running..."
|
||||
sudo systemctl enable --now NetworkManager
|
||||
|
||||
say_yellow "Setting NetworkManager to globally manage all devices..."
|
||||
sudo tee /etc/NetworkManager/conf.d/10-globally-managed-devices.conf > /dev/null <<'EOF'
|
||||
[ifupdown]
|
||||
managed=true
|
||||
|
||||
[keyfile]
|
||||
unmanaged-devices=
|
||||
EOF
|
||||
|
||||
say_yellow "Restarting NetworkManager service..."
|
||||
sudo systemctl restart NetworkManager
|
||||
|
||||
# Enable pipewire
|
||||
systemctl --user enable pipewire pipewire-pulse wireplumber
|
||||
|
||||
########################################
|
||||
# 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
|
||||
|
||||
# replace bashrc
|
||||
say_yellow "making backup of bashrc"
|
||||
sudo cp -v /etc/skel/.bashrc /etc/skel/.bashrc.starburst
|
||||
|
||||
# End of script
|
||||
say_green "Full setup completed."
|
||||
Executable
+118
@@ -0,0 +1,118 @@
|
||||
#!/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() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
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 "Starting hyprland setup..."
|
||||
|
||||
CURRENT_DE="$(detect_de)"
|
||||
CURRENT_DM="$(detect_display_manager)"
|
||||
|
||||
if [[ -z "$CURRENT_DE" ]]; then
|
||||
say_cyan -e "No Desktop Environment detected. Installing Hyprland (light setup with SDDM)..."
|
||||
|
||||
install_packages sddm hyprland dunst grim kitty polkit-kde-agent qt5-wayland qt6-wayland slurp uwsm wofi xdg-desktop-portal-hyprland
|
||||
enable_graphical_target
|
||||
|
||||
say_green -e "Hyprland with SDDM installed successfully. You can reboot now to start Hyprland."
|
||||
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 apt purge -y 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 "Hyprland / SDDM setup completed."
|
||||
Executable
+181
@@ -0,0 +1,181 @@
|
||||
#!/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() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
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,fastfetch}
|
||||
|
||||
# Removing unwanted drivers
|
||||
say_yellow "GET RID OF BROADCOM AND REALTEK DRIVERS"
|
||||
remove_packages broadcom-wl-dkms r8168-dkms rtl8821cu-morrownr-dkms-git
|
||||
|
||||
# Removing unwanted kernels
|
||||
say_yellow "KEEP LINUX KERNEL GET RID OF THE OTHER KERNELS"
|
||||
# Ensure at least one kernel remains
|
||||
if pacman -Qi linux &> /dev/null && pacman -Qi linux-headers &> /dev/null; then
|
||||
|
||||
# Define all the kernels and their headers you want to remove
|
||||
KERNELS_TO_REMOVE=(
|
||||
linux-lts-headers linux-lts
|
||||
linux-zen-headers linux-zen
|
||||
linux-hardened-headers linux-hardened
|
||||
linux-rt-headers linux-rt
|
||||
linux-rt-lts-headers linux-rt-lts
|
||||
# linux-cachyos-headers linux-cachyos
|
||||
linux-xanmod-headers linux-xanmod
|
||||
)
|
||||
remove_package() {
|
||||
local package=$1
|
||||
# Check if the package is installed
|
||||
if pacman -Q $package &> /dev/null; then
|
||||
say_yellow "$package is installed. Removing..."
|
||||
sudo pacman -Rns --noconfirm $package
|
||||
else
|
||||
say_yellow "$package is not installed."
|
||||
fi
|
||||
}
|
||||
|
||||
# Loop over the array and remove each kernel package
|
||||
for kernel in "${KERNELS_TO_REMOVE[@]}"; do
|
||||
remove_package "$kernel"
|
||||
done
|
||||
|
||||
else
|
||||
echo "Cannot proceed: At least one kernel must remain installed."
|
||||
fi
|
||||
|
||||
# Removing unwanted video drivers
|
||||
remove_packages xf86-video-amdgpu xf86-video-ati xf86-video-fbdev xf86-video-nouveau xf86-video-openchrome xf86-video-vesa
|
||||
|
||||
# Install essential tools
|
||||
install_packages wget curl nano fastfetch lolcat bash-completion starship alacritty hwinfo lshw reflector expac pamac-aur avahi man-db tree xdg-user-dirs rsync time bat unzip chromium
|
||||
# temp removed packages:
|
||||
# betterlockscreen
|
||||
if [ ! -f /usr/bin/duf ]; then
|
||||
install_packages duf
|
||||
fi
|
||||
install_packages man-db man-pages pacmanlogviewer thunar thunar-archive-plugin thunar-volman tree xdg-user-dirs polkit-gnome rate-mirrors rsync time bat ntp nss-mdns
|
||||
# temp removed packages:
|
||||
# paru-git yay-git
|
||||
|
||||
#disk-tools
|
||||
install_packages baobab gvfs-smb hddtemp squashfs-tools
|
||||
|
||||
#archive-managers
|
||||
install_packages zip gzip p7zip unace unrar unzip file-roller
|
||||
# temp removed packages:
|
||||
# peazip
|
||||
|
||||
#theming
|
||||
install_packages feh font-manager
|
||||
# temp removed packages:
|
||||
# bibata-cursor-theme
|
||||
|
||||
# All the software below will be installed on all desktops
|
||||
install_packages archlinux-tools dconf-editor devtools hardinfo2 logrotate lsb-release powertop inxi acpi plocate most namcap nm-connection-editor python-pylint python-pywal
|
||||
# temp removed packages:
|
||||
# hw-probe
|
||||
|
||||
# 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 ! compgen -G "$FONT_DIR/${FONT_NAME}*.ttf" > /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
|
||||
|
||||
# allow Chromium login with Google Account
|
||||
# Define the configuration file path
|
||||
CONF="$HOME/.config/chromium-flags.conf"
|
||||
# Check if the file exists, or create it if it doesn't
|
||||
if [[ ! -f "$CONF" ]]; then
|
||||
# Create the file if it doesn't exist
|
||||
touch "$CONF"
|
||||
echo "Created new Chromium flags file: $CONF"
|
||||
fi
|
||||
# Add the OAuth 2.0 Client ID if it's not already there
|
||||
# -q: quiet, -x: match whole line, -F: literal string match
|
||||
grep -qxF -- "--oauth2-client-id=77185425430.apps.googleusercontent.com" "$CONF" || \
|
||||
echo "--oauth2-client-id=77185425430.apps.googleusercontent.com" >>"$CONF"
|
||||
|
||||
# Add the OAuth 2.0 Client Secret if it's not already there
|
||||
grep -qxF -- "--oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT" "$CONF" || \
|
||||
echo "--oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT" >>"$CONF"
|
||||
|
||||
say_green "Chromium flags for Google Account login have been configured."
|
||||
|
||||
# Enable basic services
|
||||
#sudo systemctl enable chronyd.service
|
||||
sudo systemctl enable fstrim.timer
|
||||
|
||||
# End of script
|
||||
say_green "Minimal setup completed."
|
||||
Executable
+118
@@ -0,0 +1,118 @@
|
||||
#!/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() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
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 "Starting Niri setup..."
|
||||
|
||||
CURRENT_DE="$(detect_de)"
|
||||
CURRENT_DM="$(detect_display_manager)"
|
||||
|
||||
if [[ -z "$CURRENT_DE" ]]; then
|
||||
say_cyan -e "No Desktop Environment detected. Installing Niri (light setup with SDDM)..."
|
||||
|
||||
install_packages sddm niri noctalia-shell fuzzel swaybg xwayland-satellite swaylock
|
||||
enable_graphical_target
|
||||
|
||||
say_green -e "Niri with SDDM installed successfully. You can reboot now to start Niri."
|
||||
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 apt purge -y 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 "Niri / SDDM setup completed."
|
||||
Executable
+139
@@ -0,0 +1,139 @@
|
||||
#!/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() { sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
detect_de() {
|
||||
if command -v plasmashell >/dev/null 2>&1; then
|
||||
echo "kde"
|
||||
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 KDE Plasma installation..."
|
||||
|
||||
CURRENT_DE="$(detect_de)"
|
||||
CURRENT_DM="$(detect_display_manager)"
|
||||
|
||||
if [[ -z "$CURRENT_DE" || "$CURRENT_DE" != "kde" ]]; then
|
||||
say_cyan -e "KDE Plasma not detected. Installing KDE Plasma (light setup with SDDM)..."
|
||||
|
||||
install_packages sddm plasma
|
||||
enable_graphical_target
|
||||
|
||||
say_green -e "KDE Plasma with SDDM installed successfully. You can reboot now to start XFCE."
|
||||
else
|
||||
say_cyan -e "Detected existing Desktop Environment: $CURRENT_DE. Checking Display Manager..."
|
||||
|
||||
# Check and replace other Display Managers if they conflict with the preferred SDDM setup
|
||||
if [[ "$CURRENT_DM" != "sddm" ]]; then
|
||||
say_yellow -e "Display manager **$CURRENT_DM** is currently active. Replacing with **SDDM**, the default for KDE Plasma..."
|
||||
|
||||
# Attempt to disable the old DM if detected
|
||||
if [ ! -z "$CURRENT_DM" ]; then
|
||||
sudo systemctl disable "$CURRENT_DM" || true
|
||||
fi
|
||||
|
||||
# Remove common alternative DMs if they exist to prevent conflicts
|
||||
if is_package_installed lightdm; then
|
||||
say_gray -e "Removing lightdm..."
|
||||
remove_packages lightdm lightdm-gtk-greeter || true
|
||||
fi
|
||||
if is_package_installed gdm; then
|
||||
say_gray -e "Removing gdm..."
|
||||
remove_packages gdm || true
|
||||
fi
|
||||
|
||||
# Ensure SDDM is installed and enabled
|
||||
install_packages sddm gst-libav qt5-graphicaleffects qt5-quickcontrols qt5-quickcontrols2
|
||||
enable_graphical_target
|
||||
|
||||
say_green -e "Old display manager removed and replaced with SDDM."
|
||||
else
|
||||
say_cyan -e "Current display manager is already **SDDM**. Leaving unchanged."
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
###### TODO
|
||||
### from paru install pamac-tray-icon-plasma
|
||||
### let autostart pamac-tray-plasma
|
||||
|
||||
|
||||
# End of script
|
||||
say_green -e "KDE Plasma / SDDM setup completed."
|
||||
|
||||
Executable
+106
@@ -0,0 +1,106 @@
|
||||
#!/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() { sudo pacman -Sy; sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
say_yellow "Starting Workstation setup..."
|
||||
|
||||
# Run full first
|
||||
bash "$SCRIPT_DIR/arch-full.sh"
|
||||
|
||||
# Add extra packages
|
||||
install_packages git libreoffice-fresh
|
||||
# gitahead-git
|
||||
|
||||
# editors
|
||||
install_packages code konsole
|
||||
# temp removed packages:
|
||||
# sublime-text-4 vscodium
|
||||
|
||||
#internet
|
||||
# install_packages
|
||||
# temp removed packages
|
||||
# google-chrome discord firefox insync brave-bin
|
||||
|
||||
#theming
|
||||
# variety
|
||||
|
||||
#media
|
||||
install_packages flameshot-git mpv
|
||||
# temp removed packages
|
||||
# vlc gimp inkscape spotify lollypop mpv-full mpv-git
|
||||
|
||||
#shells
|
||||
install_packages zsh zsh-completions zsh-syntax-highlighting
|
||||
# temp removed packages
|
||||
# fish oh-my-zsh-git
|
||||
|
||||
#system-tools
|
||||
install_packages base-devel
|
||||
|
||||
#tools
|
||||
install_packages wttr system-config-printer ripgrep meld btop htop hwinfo lshw
|
||||
|
||||
# End of script
|
||||
say_green "Workstation setup completed."
|
||||
|
||||
###### TODO
|
||||
### autostart flameshot tray icon
|
||||
### autostart insync tray icon
|
||||
Executable
+133
@@ -0,0 +1,133 @@
|
||||
#!/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() { sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
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" || "$CURRENT_DE" != "xfce" ]]; then
|
||||
say_cyan -e "XFCE4 not 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. Checking Display Manager..."
|
||||
|
||||
# Check and replace other Display Managers if they conflict with the preferred SDDM setup
|
||||
if [[ "$CURRENT_DM" != "sddm" ]]; then
|
||||
say_yellow -e "Display manager **$CURRENT_DM** is currently active. Replacing with **SDDM**, the default for KDE Plasma..."
|
||||
|
||||
# Attempt to disable the old DM if detected
|
||||
if [ ! -z "$CURRENT_DM" ]; then
|
||||
sudo systemctl disable "$CURRENT_DM" || true
|
||||
fi
|
||||
|
||||
# Remove common alternative DMs if they exist to prevent conflicts
|
||||
if is_package_installed lightdm; then
|
||||
say_gray -e "Removing lightdm..."
|
||||
remove_packages lightdm lightdm-gtk-greeter || true
|
||||
fi
|
||||
if is_package_installed gdm; then
|
||||
say_gray -e "Removing gdm..."
|
||||
remove_packages gdm || true
|
||||
fi
|
||||
|
||||
# Ensure SDDM is installed and enabled
|
||||
install_packages sddm
|
||||
enable_graphical_target
|
||||
|
||||
say_green -e "Old display manager removed and replaced with SDDM."
|
||||
else
|
||||
say_cyan -e "Current display manager is already **SDDM**. Leaving unchanged."
|
||||
fi
|
||||
fi
|
||||
|
||||
# End of script
|
||||
say_green -e "XFCE / SDDM setup completed."
|
||||
|
||||
Executable
+208
@@ -0,0 +1,208 @@
|
||||
#!/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 Arch setup..."
|
||||
echo
|
||||
say_gray "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
|
||||
|
||||
##########################
|
||||
# Helper functions
|
||||
##########################
|
||||
install_packages() { sudo pacman -S --noconfirm --needed "$@"; }
|
||||
is_package_installed() { pacman -Qi "$@" &>/dev/null; }
|
||||
remove_packages() {
|
||||
local packages_to_remove=()
|
||||
|
||||
# 1. Identify which packages are actually installed
|
||||
for pkg in "$@"; do
|
||||
if is_package_installed "$pkg"; then
|
||||
packages_to_remove+=("$pkg")
|
||||
else
|
||||
say_gray "Package '$pkg' not found. Skipping removal."
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Only run pacman if there are packages to remove
|
||||
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
||||
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
||||
sudo pacman -Rs --noconfirm "${packages_to_remove[@]}" || true
|
||||
else
|
||||
say_gray "No packages to remove from the list."
|
||||
fi
|
||||
}
|
||||
|
||||
##########################
|
||||
# 1. Add repositories if missing and update system
|
||||
##########################
|
||||
# Helper function to check and add a repository
|
||||
add_repo_if_missing() {
|
||||
local repo_name="$1"
|
||||
local repo_config="$2"
|
||||
|
||||
if grep -q "\[$repo_name\]" /etc/pacman.conf; then
|
||||
say_yellow "Repository [$repo_name] already exists. Skipping."
|
||||
else
|
||||
say_yellow "Adding [$repo_name] to /etc/pacman.conf..."
|
||||
# Add a newline and the repo config to the end of the file
|
||||
echo -e "\n$repo_config" | sudo tee -a /etc/pacman.conf > /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
say_yellow "Checking pacman.conf and sources..."
|
||||
|
||||
# 1. Create the backup
|
||||
sudo cp /etc/pacman.conf "/etc/pacman.conf.bak.$(date +%s)"
|
||||
|
||||
# 2. Add yuku_repo
|
||||
YUKU_BLOCK="[yuku_repo]
|
||||
SigLevel = Never
|
||||
Server = https://yurikuit.github.io/\$repo/\$arch"
|
||||
|
||||
add_repo_if_missing "yuku_repo" "$YUKU_BLOCK"
|
||||
|
||||
# 3. Add nemesis_repo
|
||||
NEMESIS_BLOCK="[nemesis_repo]
|
||||
SigLevel = Never
|
||||
Server = https://erikdubois.github.io/\$repo/\$arch"
|
||||
|
||||
add_repo_if_missing "nemesis_repo" "$NEMESIS_BLOCK"
|
||||
|
||||
# 4. Refresh databases
|
||||
sudo pacman -Sy
|
||||
|
||||
# Update the system
|
||||
say_gray "Updating the system - sudo pacman -Syyu"
|
||||
echo
|
||||
sudo pacman -Syyu --noconfirm
|
||||
|
||||
##########################
|
||||
# 2. Fix missing console font
|
||||
##########################
|
||||
say_yellow "Fix missing console font"
|
||||
|
||||
if grep -q FONT= /etc/vconsole.conf; then
|
||||
say_green "Font is already set in /etc/vconsole.conf"
|
||||
else
|
||||
say_green "Setting console font in /etc/vconsole.conf"
|
||||
echo 'FONT=gr737c-8x14' | sudo tee -a /etc/vconsole.conf
|
||||
fi
|
||||
|
||||
##########################
|
||||
# 3. Detected OS / DE / TWM info
|
||||
##########################
|
||||
say_yellow "Detected OS / Desktop Environment / Tiling Window Manager"
|
||||
echo
|
||||
say_gray "Installing OS-specific packages..."
|
||||
say_gray "Selected DE: $DE"
|
||||
say_gray "Selected TWM: $TWM"
|
||||
say_gray "Installation Level: $INSTALL_LEVEL"
|
||||
|
||||
##########################
|
||||
# 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 "Arch 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