From 9ca3c3b727847f9537ec925d159cc7173894f353 Mon Sep 17 00:00:00 2001 From: Yuri Kuit Date: Mon, 6 Jul 2026 20:35:53 +0200 Subject: [PATCH] v3-revamp-fedora --- fedora/fedora-xfce.sh | 71 +++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/fedora/fedora-xfce.sh b/fedora/fedora-xfce.sh index 50baa2f..64237b5 100755 --- a/fedora/fedora-xfce.sh +++ b/fedora/fedora-xfce.sh @@ -110,50 +110,43 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then pause_if_debug -# Set default terminal to Alacritty - if command -v alacritty >/dev/null 2>&1; then - # 1. Force initialize the base XDG/XFCE config hierarchy - mkdir -p "$HOME/.config/xfce4" - mkdir -p "$HOME/.config/menus" - - # 2. Configure XFCE's preferred application files - HELPERS_FILE="$HOME/.config/xfce4/helpers.rc" - touch "$HELPERS_FILE" + # Set default terminal to Alacritty (Configured unconditionally) + color_cyan "Pre-configuring XFCE default terminal settings for Alacritty..." - for entry in TerminalEmulator TerminalEmulatorCommand; do - if grep -q "^${entry}=" "$HELPERS_FILE"; then - sed -i "s|^${entry}=.*|${entry}=alacritty|" "$HELPERS_FILE" - else - echo "${entry}=alacritty" >> "$HELPERS_FILE" - fi - done + # 1. Force initialize the base XDG/XFCE config hierarchy + mkdir -p "$HOME/.config/xfce4" + mkdir -p "$HOME/.config/menus" + + # 2. Configure XFCE's preferred application files + HELPERS_FILE="$HOME/.config/xfce4/helpers.rc" + touch "$HELPERS_FILE" - # 3. Create the missing standard XDG MIME association files manually - MIME_FILE="$HOME/.config/mimeapps.list" - touch "$MIME_FILE" - - # Rewrite/initialize the file cleanly with explicit defaults - cat < "$MIME_FILE" + for entry in TerminalEmulator TerminalEmulatorCommand; do + if grep -q "^${entry}=" "$HELPERS_FILE"; then + sed -i "s|^${entry}=.*|${entry}=alacritty|" "$HELPERS_FILE" + else + echo "${entry}=alacritty" >> "$HELPERS_FILE" + fi + done + + # 3. Create the standard XDG MIME association files manually + mkdir -p "$HOME/.config" + MIME_FILE="$HOME/.config/mimeapps.list" + touch "$MIME_FILE" + + # Rewrite/initialize the file cleanly with explicit defaults + cat < "$MIME_FILE" [Default Applications] x-scheme-handler/terminal=alacritty.desktop user-extension/x-terminal-emulator=alacritty.desktop EOF - # 4. Handle System-Wide Alternatives (For Debian/Ubuntu/Fedora base integrations) - # This covers the underlying system-wide 'x-terminal-emulator' mapping - if command -v update-alternatives >/dev/null 2>&1; then - if [ -f "/usr/share/applications/alacritty.desktop" ] || [ -f "/usr/local/share/applications/alacritty.desktop" ]; then - sudo update-alternatives --set x-terminal-emulator $(which alacritty) 2>/dev/null || true - fi - fi - - # 5. Pre-seed Xfconf properties directly into the XML tree file structure - # Since xfconfd might not be running yet, we write the raw file backup structure directly - XFCONF_DIR="$HOME/.config/xfce4/xfconf/xfce-perchannel-xml" - mkdir -p "$XFCONF_DIR" - - # Pre-populate the session XML so xfce skips selection entirely on first boot - cat < "$XFCONF_DIR/xfce4-session.xml" + # 4. Pre-seed Xfconf properties directly into the XML tree file structure + # This bypasses xfconf-query entirely and drops settings directly into storage + XFCONF_DIR="$HOME/.config/xfce4/xfconf/xfce-perchannel-xml" + mkdir -p "$XFCONF_DIR" + + cat < "$XFCONF_DIR/xfce4-session.xml" @@ -162,8 +155,8 @@ EOF EOF - color_green "XFCE default terminal configurations written directly to persistent user storage!" - fi + color_green "XFCE terminal presets dropped into user skeleton profiles successfully." + fi pause_if_debug