bugfix
This commit is contained in:
@@ -132,6 +132,7 @@ fi
|
|||||||
SOURCE_DIR="$SCRIPT_DIR/config-files/debian"
|
SOURCE_DIR="$SCRIPT_DIR/config-files/debian"
|
||||||
DEST_DIR="$HOME"
|
DEST_DIR="$HOME"
|
||||||
AUTOSTART_DIR="$HOME/.config/autostart"
|
AUTOSTART_DIR="$HOME/.config/autostart"
|
||||||
|
HELPER_DIR="$HOME/.local/share/xfce-config-apply"
|
||||||
XFCE_SESSION_DIR="$HOME/.cache/sessions"
|
XFCE_SESSION_DIR="$HOME/.cache/sessions"
|
||||||
|
|
||||||
# 1. Verify source directory exists
|
# 1. Verify source directory exists
|
||||||
@@ -144,35 +145,44 @@ fi
|
|||||||
if pgrep -x "xfce4-panel" >/dev/null || pgrep -x "xfconfd" >/dev/null; then
|
if pgrep -x "xfce4-panel" >/dev/null || pgrep -x "xfconfd" >/dev/null; then
|
||||||
say_yellow "XFCE session is currently active."
|
say_yellow "XFCE session is currently active."
|
||||||
|
|
||||||
# Check if we're on a Debian-based system
|
# Debian-based detection
|
||||||
if grep -qiE "debian|ubuntu|mint" /etc/os-release; then
|
if grep -qiE "debian|ubuntu|mint" /etc/os-release; then
|
||||||
say_yellow "Detected Debian-based system. Deferring configuration to next login."
|
say_yellow "Detected Debian-based system. Scheduling configuration for next login."
|
||||||
|
|
||||||
mkdir -p "$AUTOSTART_DIR"
|
mkdir -p "$AUTOSTART_DIR" "$HELPER_DIR"
|
||||||
AUTOSTART_FILE="$AUTOSTART_DIR/xfce-config-apply.desktop"
|
AUTOSTART_FILE="$AUTOSTART_DIR/xfce-config-apply.desktop"
|
||||||
|
HELPER_SCRIPT="$HELPER_DIR/run-once.sh"
|
||||||
|
|
||||||
cat > "$AUTOSTART_FILE" <<EOF
|
# --- Create helper script ---
|
||||||
[Desktop Entry]
|
cat > "$HELPER_SCRIPT" <<EOF
|
||||||
Type=Application
|
#!/usr/bin/env bash
|
||||||
Name=Apply XFCE Config
|
|
||||||
Comment=One-time XFCE configuration importer
|
|
||||||
Exec=bash -c '
|
|
||||||
shopt -s dotglob
|
shopt -s dotglob
|
||||||
cp -vrf "$SOURCE_DIR"/* "$DEST_DIR"/
|
cp -vrf "$SOURCE_DIR"/* "$DEST_DIR"/
|
||||||
shopt -u dotglob
|
shopt -u dotglob
|
||||||
rm -rf "$XFCE_SESSION_DIR"
|
rm -rf "$XFCE_SESSION_DIR"
|
||||||
rm -f "$AUTOSTART_FILE"
|
rm -f "$AUTOSTART_FILE"
|
||||||
echo "XFCE config applied on login and autostart entry removed."
|
rm -rf "$HELPER_DIR"
|
||||||
'
|
echo "XFCE configuration applied and helper removed."
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod +x "$HELPER_SCRIPT"
|
||||||
|
|
||||||
|
# --- Create autostart file ---
|
||||||
|
cat > "$AUTOSTART_FILE" <<EOF
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=Apply XFCE Config
|
||||||
|
Comment=One-time XFCE configuration importer
|
||||||
|
Exec=$HELPER_SCRIPT
|
||||||
OnlyShowIn=XFCE;
|
OnlyShowIn=XFCE;
|
||||||
X-GNOME-Autostart-enabled=true
|
X-GNOME-Autostart-enabled=true
|
||||||
Hidden=false
|
Hidden=false
|
||||||
NoDisplay=false
|
NoDisplay=false
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
say_green "Created one-time autostart task:"
|
say_green "Created one-time autostart helper:"
|
||||||
say_gray " $AUTOSTART_FILE"
|
say_gray " $AUTOSTART_FILE"
|
||||||
say_cyan "Log out and back in to apply the new XFCE configuration."
|
say_cyan "→ Log out and back in to apply your new XFCE configuration."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
say_cyan "Non-Debian system detected — applying configuration live."
|
say_cyan "Non-Debian system detected — applying configuration live."
|
||||||
|
|||||||
Reference in New Issue
Block a user