v3-revamp-fedora
This commit is contained in:
+29
-36
@@ -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"
|
||||
# Set default terminal to Alacritty (Configured unconditionally)
|
||||
color_cyan "Pre-configuring XFCE default terminal settings for Alacritty..."
|
||||
|
||||
# 2. Configure XFCE's preferred application files
|
||||
HELPERS_FILE="$HOME/.config/xfce4/helpers.rc"
|
||||
touch "$HELPERS_FILE"
|
||||
# 1. Force initialize the base XDG/XFCE config hierarchy
|
||||
mkdir -p "$HOME/.config/xfce4"
|
||||
mkdir -p "$HOME/.config/menus"
|
||||
|
||||
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
|
||||
# 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"
|
||||
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
|
||||
|
||||
# Rewrite/initialize the file cleanly with explicit defaults
|
||||
cat <<EOF > "$MIME_FILE"
|
||||
# 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 <<EOF > "$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
|
||||
# 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"
|
||||
|
||||
# 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 <<EOF > "$XFCONF_DIR/xfce4-session.xml"
|
||||
cat <<EOF > "$XFCONF_DIR/xfce4-session.xml"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channel name="xfce4-session" version="1.0">
|
||||
<property name="general" type="empty">
|
||||
@@ -162,8 +155,8 @@ EOF
|
||||
</channel>
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user