From 57802420685115187c089e08554519d9ca0e51ce Mon Sep 17 00:00:00 2001 From: SirBlobby Date: Wed, 19 Aug 2026 14:00:43 -0400 Subject: [PATCH] Start AGS once, after the theme reapply Claude-Session: https://claude.ai/code/session_014ADhvRXuiTvrXSbConxUey --- install.sh | 21 ++++++++++++--------- omarchy/hooks/theme-set | 3 ++- revert.sh | 3 ++- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 1b3a9eb..db02199 100755 --- a/install.sh +++ b/install.sh @@ -388,15 +388,6 @@ else echo "Warning: omarchy-restart-shell not found. Please restart the shell manually." fi -echo "" -echo "=== Restarting AGS ===" -if command -v ags &> /dev/null; then - ags quit || true - nohup ags run -d "$HOME_DIR/.config/ags" >/dev/null 2>&1 & -else - echo "Warning: ags not found. Please start ags manually." -fi - echo "" echo "=== Reloading Hyprland ===" if command -v hyprctl &> /dev/null; then @@ -414,6 +405,18 @@ else echo "Warning: no active theme found. Run blob_theme to generate zen.css." fi +# Started after the theme reapply, because the theme-set hook restarts AGS +# too. Starting it first only races that hook for the instance name. +echo "" +echo "=== Restarting AGS ===" +if command -v ags &> /dev/null; then + ags quit >/dev/null 2>&1 || true + sleep 0.5 + nohup ags run -d "$HOME_DIR/.config/ags" >/dev/null 2>&1 & +else + echo "Warning: ags not found. Please start ags manually." +fi + echo "" echo "=== Installation Complete ===" echo "Scripts are in: $HOME_DIR/scripts/" diff --git a/omarchy/hooks/theme-set b/omarchy/hooks/theme-set index dfd9912..d8ec0bd 100755 --- a/omarchy/hooks/theme-set +++ b/omarchy/hooks/theme-set @@ -7,6 +7,7 @@ awk -F '=' 'NF==2 { gsub(/"/,"",$2); gsub(/ /,"",$1); gsub(/ /,"",$2); print "@d # Restart AGS to apply new theme colors if command -v ags &> /dev/null; then - ags quit || true + ags quit >/dev/null 2>&1 || true + sleep 0.5 nohup ags run -d "$HOME/.config/ags" >/dev/null 2>&1 & fi diff --git a/revert.sh b/revert.sh index 2ba88c6..52b7531 100755 --- a/revert.sh +++ b/revert.sh @@ -112,7 +112,8 @@ fi echo "" echo "=== Restarting AGS ===" if command -v ags &> /dev/null; then - ags quit || true + ags quit >/dev/null 2>&1 || true + sleep 0.5 nohup ags run -d "$HOME_DIR/.config/ags" >/dev/null 2>&1 & else echo "Warning: ags not found. Please start ags manually."