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

@@ -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-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)
# 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

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