From cf7f1a9f7e2c7c612bfac2f1b3fd9da330e05340 Mon Sep 17 00:00:00 2001 From: Pepe44DEV Date: Wed, 27 May 2026 23:11:41 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20theme=20application=20h=C3=A4ngt=20nicht?= =?UTF-8?q?=20auf=20frischer=20VM=20(alle=20Display-D-Bus-Aufrufe=20guarde?= =?UTF-8?q?d)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- dotfiles/hypr/Scripts/theme-menu.sh | 87 +++++++++++++++-------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/dotfiles/hypr/Scripts/theme-menu.sh b/dotfiles/hypr/Scripts/theme-menu.sh index b505bc4..23e9195 100755 --- a/dotfiles/hypr/Scripts/theme-menu.sh +++ b/dotfiles/hypr/Scripts/theme-menu.sh @@ -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