From 94aec264ecb84306dc1cb263dd273bd4a8507dfd Mon Sep 17 00:00:00 2001 From: "yuri.kuit" Date: Sat, 23 May 2026 21:33:36 +0200 Subject: [PATCH] fedora full and workstation --- v2/fedora-full.sh | 162 +++++++++++++++++++++++++++++++++++++++ v2/fedora-workstation.sh | 108 ++++++++++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100755 v2/fedora-full.sh create mode 100755 v2/fedora-workstation.sh diff --git a/v2/fedora-full.sh b/v2/fedora-full.sh new file mode 100755 index 0000000..7d929d1 --- /dev/null +++ b/v2/fedora-full.sh @@ -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." diff --git a/v2/fedora-workstation.sh b/v2/fedora-workstation.sh new file mode 100755 index 0000000..be3ed04 --- /dev/null +++ b/v2/fedora-workstation.sh @@ -0,0 +1,108 @@ +#!/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 konsole +# temp removed packages: +# sublime-text-4 vscodium +flatpak install flathub com.vscodium.codium + + +#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