fix: theme application hängt nicht auf frischer VM (alle Display-D-Bus-Aufrufe guarded)

Vier Änderungen:

1. Duplikat in apply_wallpaper entfernt (überlappende Edits hinterließen
   einen zweiten hyprctl-Block außerhalb des pgrep-Guards)

2. gsettings in write_gtk_settings hinter pgrep -x Hyprland guard
   (gsettings set → D-Bus → könnte swaync auto-starten → hängt)

3. kwriteconfig6 in write_kde_color_scheme hinter pgrep -x Hyprland
   (kwriteconfig6 schreibt nicht nur Config, macht auch D-Bus-Calls)

4. apply_theme() blockt jetzt komplett: ALLE Display-Aufrufe
   (hyprctl, swaync-client, waybar, notify, awww, swww, gsettings,
   kwriteconfig6) werden nur ausgeführt wenn Hyprland läuft.

Ohne Hyprland: nur Config-Files schreiben (load_theme, write_app_styles,
write_desktop_app_theme, write_hyprlock_theme, write_starship_theme,
write_sddm_theme_assets, apply_wallpaper-schreibt-nur). Kein einziger
D-Bus-Call fällt mehr an.
This commit is contained in:
2026-05-27 23:11:41 +02:00
parent a76f1f3af7
commit cf7f1a9f7e

View File

@@ -199,7 +199,7 @@ EOF
EOF
done
if command -v gsettings >/dev/null 2>&1; then
if command -v gsettings >/dev/null 2>&1 && pgrep -x Hyprland >/dev/null 2>&1; then
gsettings set org.gnome.desktop.interface color-scheme "$APP_THEME_MODE" >/dev/null 2>&1 || true
gsettings set org.gnome.desktop.interface accent-color "$GNOME_ACCENT_COLOR" >/dev/null 2>&1 || true
gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME_NAME" >/dev/null 2>&1 || true
@@ -458,7 +458,7 @@ inactiveBackground=$panel_rgb
inactiveForeground=$muted_rgb
EOF
if command -v kwriteconfig6 >/dev/null 2>&1; then
if command -v kwriteconfig6 >/dev/null 2>&1 && pgrep -x Hyprland >/dev/null 2>&1; then
kwriteconfig6 --file kdeglobals --group General --key ColorScheme "$KDE_COLOR_SCHEME" >/dev/null 2>&1 || true
kwriteconfig6 --file kdeglobals --group General --key Name "$NAME" >/dev/null 2>&1 || true
kwriteconfig6 --file kdeglobals --group Icons --key Theme "$ICON_THEME_NAME" >/dev/null 2>&1 || true
@@ -1076,43 +1076,46 @@ EOF
printf '%s\n' "$WALLPAPER" >"$CURRENT_WALLPAPER"
if command -v awww >/dev/null 2>&1; then
if ! pgrep -x awww-daemon >/dev/null 2>&1; then
start_detached awww-daemon
sleep 0.2
if pgrep -x Hyprland >/dev/null 2>&1; then
if command -v awww >/dev/null 2>&1; then
if ! pgrep -x awww-daemon >/dev/null 2>&1; then
start_detached awww-daemon
sleep 0.2
fi
awww img "$WALLPAPER" \
--transition-type "$TRANSITION_TYPE" \
--transition-duration "$TRANSITION_DURATION" \
--transition-fps "$TRANSITION_FPS" \
--transition-pos "$TRANSITION_POS" >/dev/null 2>&1 || true
return
fi
awww img "$WALLPAPER" \
--transition-type "$TRANSITION_TYPE" \
--transition-duration "$TRANSITION_DURATION" \
--transition-fps "$TRANSITION_FPS" \
--transition-pos "$TRANSITION_POS" >/dev/null 2>&1 || true
return
fi
if command -v swww >/dev/null 2>&1; then
if ! pgrep -x swww-daemon >/dev/null 2>&1; then
start_detached swww-daemon
sleep 0.2
fi
if command -v swww >/dev/null 2>&1; then
if ! pgrep -x swww-daemon >/dev/null 2>&1; then
start_detached swww-daemon
sleep 0.2
swww img "$WALLPAPER" \
--transition-type "$TRANSITION_TYPE" \
--transition-duration "$TRANSITION_DURATION" \
--transition-fps "$TRANSITION_FPS" \
--transition-pos "$TRANSITION_POS" >/dev/null 2>&1 || true
return
fi
swww img "$WALLPAPER" \
--transition-type "$TRANSITION_TYPE" \
--transition-duration "$TRANSITION_DURATION" \
--transition-fps "$TRANSITION_FPS" \
--transition-pos "$TRANSITION_POS" >/dev/null 2>&1 || true
return
fi
if command -v hyprctl >/dev/null 2>&1; then
if ! pgrep -x hyprpaper >/dev/null 2>&1; then
start_detached hyprpaper
sleep 0.2
fi
if command -v hyprctl >/dev/null 2>&1 && pgrep -x Hyprland >/dev/null 2>&1; then
if ! pgrep -x hyprpaper >/dev/null 2>&1; then
start_detached hyprpaper
sleep 0.2
hyprctl hyprpaper preload "$WALLPAPER" >/dev/null || true
hyprctl hyprpaper wallpaper ",$WALLPAPER" >/dev/null || true
fi
hyprctl hyprpaper preload "$WALLPAPER" >/dev/null || true
hyprctl hyprpaper wallpaper ",$WALLPAPER" >/dev/null || true
fi
}
apply_theme() {
@@ -1139,19 +1142,21 @@ EOF
hyprctl keyword general:col.inactive_border "$INACTIVE_BORDER" >/dev/null || true
fi
if command -v swaync-client >/dev/null 2>&1; then
swaync-client -rs >/dev/null 2>&1 || true
fi
if pgrep -x Hyprland >/dev/null 2>&1; then
if command -v swaync-client >/dev/null 2>&1; then
swaync-client -rs >/dev/null 2>&1 || true
fi
if command -v waybar >/dev/null 2>&1 && pgrep -x Hyprland >/dev/null 2>&1; then
restart_waybar
fi
if command -v waybar >/dev/null 2>&1; then
restart_waybar
fi
if pgrep -x nautilus >/dev/null 2>&1; then
nautilus -q >/dev/null 2>&1 || pkill -x nautilus >/dev/null 2>&1 || true
fi
if pgrep -x nautilus >/dev/null 2>&1; then
nautilus -q >/dev/null 2>&1 || pkill -x nautilus >/dev/null 2>&1 || true
fi
notify "$NAME aktiviert."
notify "$NAME aktiviert."
fi
}
if [[ "${1:-}" == "--apply" ]]; then