fix(theme): wire obsidian sync into theme-set; drop vscode placeholder

Phase B verdict on two unused? entries in the theme-engine scripts.

- nomarchy-theme-set-obsidian: real script that copies the active
  theme's obsidian.css into every Obsidian vault under
  ~/.config/obsidian/obsidian.json. Wires it into nomarchy-theme-set
  next to the btop/opencode hot-reloads. Self-gates twice (no
  obsidian.css → exit 0; no .obsidian dir → continue), so it's a
  no-op for users without Obsidian.

- nomarchy-theme-set-vscode: delete-dead. Its own comment admitted
  it was "mostly a placeholder"; its only action (nomarchy-env-update)
  is already done unconditionally upstream by nomarchy-theme-set.
  The NOMARCHY_TOGGLE_SKIP_VSCODE_THEME env var it gated on is
  exported by features/scripts/default.nix:73 from
  nomarchy.toggles.skipVsCodeTheme, but with this script gone there
  are no consumers; the toggle survives as a public option until a
  follow-up wires it through the VSCode module properly.

SCRIPTS.md regenerated: unused? 34 → 32, kept 165 → 166. nix flake
check clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-04-25 22:18:03 +01:00
parent d2b508485a
commit 983ade0f55
3 changed files with 10 additions and 27 deletions

View File

@@ -24,7 +24,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`,
- `delete-dead` — Phase B verdict: remove and update callers. - `delete-dead` — Phase B verdict: remove and update callers.
- `stub-with-notify` — Phase B verdict: temporary `notify-send` stub. - `stub-with-notify` — Phase B verdict: temporary `notify-send` stub.
## Scripts (132) ## Scripts (131)
| Script | Location | Callers | Status | Notes | | Script | Location | Callers | Status | Notes |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
@@ -49,7 +49,7 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`,
| `nomarchy-drive-info` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-select | `kept` | | | `nomarchy-drive-info` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-select | `kept` | |
| `nomarchy-drive-select` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-info,features/scripts/utils/nomarchy-drive-set-password | `kept` | | | `nomarchy-drive-select` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-info,features/scripts/utils/nomarchy-drive-set-password | `kept` | |
| `nomarchy-drive-set-password` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-select,features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-drive-set-password` | `features/scripts/utils` | features/scripts/utils/nomarchy-drive-select,features/scripts/utils/nomarchy-menu | `kept` | |
| `nomarchy-env-update` | `features/scripts/utils` | core/home/bash.nix,core/system/scripts/nomarchy-pkg-add, +9 more | `kept` | | | `nomarchy-env-update` | `features/scripts/utils` | core/home/bash.nix,core/system/scripts/nomarchy-pkg-add, +8 more | `kept` | |
| `nomarchy-font-current` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-font-current` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu | `kept` | |
| `nomarchy-font-list` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +1 more | `kept` | | | `nomarchy-font-list` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +1 more | `kept` | |
| `nomarchy-font-set` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +3 more | `kept` | | | `nomarchy-font-set` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +3 more | `kept` | |
@@ -125,13 +125,12 @@ Phase B (per-batch PRs) refines those into `port-from-omarchy`,
| `nomarchy-theme-list` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-welcome | `kept` | | | `nomarchy-theme-list` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-welcome | `kept` | |
| `nomarchy-theme-refresh` | `themes/engine/scripts` | — | `unused?` | | | `nomarchy-theme-refresh` | `themes/engine/scripts` | — | `unused?` | |
| `nomarchy-theme-remove` | `themes/engine/scripts` | — | `unused?` | | | `nomarchy-theme-remove` | `themes/engine/scripts` | — | `unused?` | |
| `nomarchy-theme-set` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-on-boot, +8 more | `kept` | | | `nomarchy-theme-set` | `themes/engine/scripts` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-on-boot, +7 more | `kept` | |
| `nomarchy-theme-set-keyboard` | `themes/engine/scripts` | features/scripts/utils/nomarchy-on-boot | `kept` | | | `nomarchy-theme-set-keyboard` | `themes/engine/scripts` | features/scripts/utils/nomarchy-on-boot | `kept` | |
| `nomarchy-theme-set-keyboard-asus-rog` | `themes/engine/scripts` | features/scripts/utils/nomarchy-on-boot,themes/engine/scripts/nomarchy-theme-set-keyboard | `kept` | | | `nomarchy-theme-set-keyboard-asus-rog` | `themes/engine/scripts` | features/scripts/utils/nomarchy-on-boot,themes/engine/scripts/nomarchy-theme-set-keyboard | `kept` | |
| `nomarchy-theme-set-keyboard-f16` | `themes/engine/scripts` | features/scripts/utils/nomarchy-on-boot,themes/engine/scripts/nomarchy-theme-set-keyboard | `kept` | | | `nomarchy-theme-set-keyboard-f16` | `themes/engine/scripts` | features/scripts/utils/nomarchy-on-boot,themes/engine/scripts/nomarchy-theme-set-keyboard | `kept` | |
| `nomarchy-theme-set-obsidian` | `themes/engine/scripts` | — | `unused?` | | | `nomarchy-theme-set-obsidian` | `themes/engine/scripts` | themes/engine/scripts/nomarchy-theme-set | `kept` | |
| `nomarchy-theme-set-templates` | `themes/engine/scripts` | themes/engine/scripts/nomarchy-theme-set | `kept` | | | `nomarchy-theme-set-templates` | `themes/engine/scripts` | themes/engine/scripts/nomarchy-theme-set | `kept` | |
| `nomarchy-theme-set-vscode` | `themes/engine/scripts` | — | `unused?` | |
| `nomarchy-themes-prebuild` | `themes/engine/scripts` | installer/install.sh | `kept` | | | `nomarchy-themes-prebuild` | `themes/engine/scripts` | installer/install.sh | `kept` | |
| `nomarchy-theme-update` | `themes/engine/scripts` | features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-theme-update` | `themes/engine/scripts` | features/scripts/utils/nomarchy-menu | `kept` | |
| `nomarchy-toggle-hybrid-gpu` | `core/system/scripts` | features/scripts/utils/nomarchy-menu | `kept` | | | `nomarchy-toggle-hybrid-gpu` | `core/system/scripts` | features/scripts/utils/nomarchy-menu | `kept` | |
@@ -217,8 +216,8 @@ Tokens grepped from `core/`, `features/`, `themes/`, `installer/`, `hosts/`, `bi
| `nomarchy-swayosd-brightness` | core/system/scripts/nomarchy-brightness-display,core/system/scripts/nomarchy-brightness-display-apple, +1 more | `missing` | | `nomarchy-swayosd-brightness` | core/system/scripts/nomarchy-brightness-display,core/system/scripts/nomarchy-brightness-display-apple, +1 more | `missing` |
| `nomarchy-swayosd-kbd-brightness` | core/system/scripts/nomarchy-brightness-keyboard,features/desktop/scripts/nomarchy-swayosd-kbd-brightness | `missing` | | `nomarchy-swayosd-kbd-brightness` | core/system/scripts/nomarchy-brightness-keyboard,features/desktop/scripts/nomarchy-swayosd-kbd-brightness | `missing` |
| `nomarchy-system-scripts` | core/system/hardware.nix,core/system/scripts-derivation.nix, +1 more | `missing` | | `nomarchy-system-scripts` | core/system/hardware.nix,core/system/scripts-derivation.nix, +1 more | `missing` |
| `nomarchy-theme` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +14 more | `missing` | | `nomarchy-theme` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +13 more | `missing` |
| `nomarchy-theme-` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +14 more | `missing` | | `nomarchy-theme-` | core/home/config/nomarchy-skill/SKILL.md,features/scripts/utils/nomarchy-menu, +13 more | `missing` |
| `nomarchy-theme-engine-scripts` | themes/engine/scripts.nix | `missing` | | `nomarchy-theme-engine-scripts` | themes/engine/scripts.nix | `missing` |
| `nomarchy-theme-next` | core/home/config/nomarchy-skill/SKILL.md | `missing` | | `nomarchy-theme-next` | core/home/config/nomarchy-skill/SKILL.md | `missing` |
| `nomarchy-theme-selector` | themes/engine/switcher.nix | `missing` | | `nomarchy-theme-selector` | themes/engine/switcher.nix | `missing` |

View File

@@ -64,6 +64,10 @@ command -v nomarchy-restart-waybar >/dev/null 2>&1 && nomarchy-restart-waybar ||
command -v nomarchy-restart-btop >/dev/null 2>&1 && nomarchy-restart-btop || true 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 command -v nomarchy-restart-opencode >/dev/null 2>&1 && nomarchy-restart-opencode || true
# Sync palette into Obsidian vaults (no-op when the user has no Obsidian
# config or no obsidian.css template in the active theme).
command -v nomarchy-theme-set-obsidian >/dev/null 2>&1 && nomarchy-theme-set-obsidian || true
# Reload the wallpaper — its ExecStart path is stable (~/.config/nomarchy/current/background) # 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. # 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 systemctl --user restart nomarchy-wallpaper.service 2>/dev/null || true

View File

@@ -1,20 +0,0 @@
#!/usr/bin/env bash
# Nomarchy VS Code Theme Setter
# This script only updates the global state.json.
# Home Manager (modules/home/vscode.nix) handles the declarative settings injection.
STATE_DIR="$HOME/.config/nomarchy"
STATE_FILE="$STATE_DIR/state.json"
mkdir -p "$STATE_DIR"
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
# Theme is already set in state.json by nomarchy-theme-set.
# This script is now mostly a placeholder to maintain the same workflow,
# triggering an env-update if needed to apply the declarative changes.
if [[ $NOMARCHY_TOGGLE_SKIP_VSCODE_THEME != "true" ]]; then
# We trigger nomarchy-env-update to apply the new VSCode theme declaratively.
nomarchy-env-update
fi