From d2b508485aa155cd6ccbb109c9d868af71904045 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Sat, 25 Apr 2026 22:13:52 +0100 Subject: [PATCH] fix(theme): hot-reload btop and opencode on theme switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase B verdict on two unused? scripts — both inline comments claimed they were "used by the Nomarchy theme switching", but the switcher (themes/engine/scripts/nomarchy-theme-set) only restarted walker, waybar, and the wallpaper service. So btop and opencode stayed on the old palette after `nomarchy-theme-set ` until the user closed and reopened them by hand. Wires both into nomarchy-theme-set, alongside the existing walker / waybar restart calls. The check-then-call (`command -v ... &&`) matches the surrounding style — a missing helper is a no-op, not a fatal. SCRIPTS.md regenerated: unused? 36 → 34, kept 163 → 165. Co-Authored-By: Claude Opus 4.7 --- docs/SCRIPTS.md | 4 ++-- themes/engine/scripts/nomarchy-theme-set | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/SCRIPTS.md b/docs/SCRIPTS.md index e08bbfc..6112893 100644 --- a/docs/SCRIPTS.md +++ b/docs/SCRIPTS.md @@ -90,8 +90,8 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`, | `nomarchy-refresh-fastfetch` | `features/scripts/utils` | — | `unused?` | | | `nomarchy-restart-app` | `features/scripts/utils` | core/system/scripts/nomarchy-restart-xcompose,features/desktop/scripts/nomarchy-restart-hypridle, +3 more | `kept` | | | `nomarchy-restart-bluetooth` | `core/system/scripts` | features/scripts/utils/nomarchy-menu | `kept` | | -| `nomarchy-restart-btop` | `features/scripts/utils` | — | `unused?` | | -| `nomarchy-restart-opencode` | `features/scripts/utils` | — | `unused?` | | +| `nomarchy-restart-btop` | `features/scripts/utils` | themes/engine/scripts/nomarchy-theme-set | `kept` | | +| `nomarchy-restart-opencode` | `features/scripts/utils` | themes/engine/scripts/nomarchy-theme-set | `kept` | | | `nomarchy-restart-pipewire` | `core/system/scripts` | features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-restart-terminal` | `features/scripts/utils` | core/home/config/nomarchy-skill/SKILL.md | `kept` | | | `nomarchy-restart-tmux` | `features/scripts/utils` | — | `unused?` | | diff --git a/themes/engine/scripts/nomarchy-theme-set b/themes/engine/scripts/nomarchy-theme-set index 36b22b5..e2748ad 100755 --- a/themes/engine/scripts/nomarchy-theme-set +++ b/themes/engine/scripts/nomarchy-theme-set @@ -58,6 +58,12 @@ nomarchy-theme-set-templates command -v nomarchy-restart-walker >/dev/null 2>&1 && nomarchy-restart-walker || true command -v nomarchy-restart-waybar >/dev/null 2>&1 && nomarchy-restart-waybar || true +# Hot-reload long-running TUIs / agents that read their colors from +# the active-theme symlink and would otherwise stay on the old palette +# until the user restarts them by hand. +command -v nomarchy-restart-btop >/dev/null 2>&1 && nomarchy-restart-btop || true +command -v nomarchy-restart-opencode >/dev/null 2>&1 && nomarchy-restart-opencode || true + # Reload the wallpaper — its ExecStart path is stable (~/.config/nomarchy/current/background) # so sd-switch does not detect a unit change when only the symlink target moves. systemctl --user restart nomarchy-wallpaper.service 2>/dev/null || true