From e7e89b8333610239feab2ba62093ce7334d8fcad Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Fri, 22 May 2026 17:59:15 +0100 Subject: [PATCH] chore(theme): prune 9 dead templates, document the 2 that ship MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit themes/templates/ shipped 11 mustache templates, but nomarchy-theme-set-templates only writes to a path when no file is already there — and a careful trace shows 9 of the 11 outputs are either preempted by an earlier write or never read at all: - kitty.conf.tpl, ghostty.conf.tpl → shadowed by the per-palette generators in themes/engine/files.nix added in 8d3ce2d. - hyprland.conf.tpl → shadowed by files.nix:100, which always writes ~/.config/nomarchy/current/theme/hyprland.conf from the palette/feature/nord fallback chain. - hyprlock.conf.tpl, alacritty.toml.tpl, btop.theme.tpl, chromium.theme.tpl, swayosd.css.tpl → output paths nothing reads. alacritty + swayosd are themed via Stylix / declarative HM options inline. btop reads from ~/.config/btop/themes/nomarchy.theme (loader.nix:72), not from the theme symlink. chromium is themed via the managed- policy module in core/system/browser.nix. hyprlock has no consumer of theme/hyprlock.conf anywhere in the tree. - hyprland-preview-share-picker.css.tpl → orphaned when the share-picker dir was deleted in 20de3d4. obsidian.css.tpl and keyboard.rgb.tpl stay: the first is consumed by nomarchy-theme-set-obsidian (copied into every Obsidian vault), the second by nomarchy-theme-set-keyboard-asus-rog (sets the ROG keyboard tint via asusctl). Rewrote Step 6 of docs/creating-themes.md to describe the two live templates by name and corrected a path bug ("~/.config/nomarchy/themed/" → "~/.config/nomarchy/themes/templates/" — the script actually reads the latter). `nix flake check --no-build` clean. --- docs/ROADMAP.md | 1 + docs/creating-themes.md | 25 +++-- themes/templates/alacritty.toml.tpl | 47 ---------- themes/templates/btop.theme.tpl | 83 ---------------- themes/templates/chromium.theme.tpl | 1 - themes/templates/ghostty.conf.tpl | 22 ----- .../hyprland-preview-share-picker.css.tpl | 94 ------------------- themes/templates/hyprland.conf.tpl | 9 -- themes/templates/hyprlock.conf.tpl | 5 - themes/templates/kitty.conf.tpl | 27 ------ themes/templates/swayosd.css.tpl | 5 - 11 files changed, 18 insertions(+), 301 deletions(-) delete mode 100644 themes/templates/alacritty.toml.tpl delete mode 100644 themes/templates/btop.theme.tpl delete mode 100644 themes/templates/chromium.theme.tpl delete mode 100644 themes/templates/ghostty.conf.tpl delete mode 100644 themes/templates/hyprland-preview-share-picker.css.tpl delete mode 100644 themes/templates/hyprland.conf.tpl delete mode 100644 themes/templates/hyprlock.conf.tpl delete mode 100644 themes/templates/kitty.conf.tpl delete mode 100644 themes/templates/swayosd.css.tpl diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index e3499c0..09c49be 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -157,6 +157,7 @@ Pillar is **done** when every component has a closed `wave/qa-` PR an (Move items here when they land — keep them brief, link the commit/PR.) +- _2026-05-22_ — **`themes/templates/*.tpl` pruned.** Deleted 9 of the 11 mustache templates after verifying their output paths are either preempted by Nix-side writes (`hyprland.conf.tpl` shadowed by `themes/engine/files.nix:100`; `kitty.conf.tpl` + `ghostty.conf.tpl` shadowed by the per-palette generators added in commit `8d3ce2d`), unread by anything (`hyprlock.conf.tpl`, `alacritty.toml.tpl`, `btop.theme.tpl`, `chromium.theme.tpl`, `swayosd.css.tpl` — the corresponding apps are themed via Stylix / declarative Home-Manager options / the system policy module, not from the theme symlink), or orphaned (`hyprland-preview-share-picker.css.tpl` lost its consumer when the share-picker dir was deleted in `20de3d4`). Only `obsidian.css.tpl` (consumed by `nomarchy-theme-set-obsidian` to seed every Obsidian vault's theme) and `keyboard.rgb.tpl` (consumed by `nomarchy-theme-set-keyboard-asus-rog` to set the ROG keyboard tint) stay. Rewrote Step 6 of `docs/creating-themes.md` to describe the two remaining templates explicitly and corrected a long-standing path bug ("`~/.config/nomarchy/themed/`" → "`~/.config/nomarchy/themes/templates/`" — the script actually reads the latter). `nix flake check --no-build` clean. - _2026-05-22_ — **Pillar 4: "What's installed?" first-boot summary.** New `nomarchy-installed-summary` script renders a markdown table (via `gum format`, plain fallback) showing the install shape the user should verify before customising: theme / font / panel position (read from `~/.config/nomarchy/state.json`), timezone / DNS / hybrid-GPU (read from `/etc/nixos/state.json`), form factor (`BAT*` sysfs check — same signal the installer uses), software profiles (heuristic via presence of marker binaries: `docker` → Dev, `steam` → Gaming, `libreoffice` → Office, `obs` → Media, `rg` → CLI Utils), FDE status (any `crypt` entry in `lsblk`), and the drive layout (filtered `lsblk -no NAME,SIZE,TYPE,MOUNTPOINT`). `nomarchy-welcome` now calls it as Step 0 (gated on a `gum input` so the user acknowledges before customisation rewrites anything) and the same command works standalone from any terminal. No installer-side changes — the script is fully self-contained against existing state files and live introspection. Closes the "Installer: What's installed? summary on first boot" Now-column item. - _2026-05-21_ — **Pillar 8 / Component 9 (ISOs): closeout — Pillar 8 code-audit phase complete.** Code-review-shaped sweep over `hosts/{nomarchy-installer,nomarchy-live}.nix`, the `installation-cd-minimal`/`installation-cd-graphical-base` module chain, and the four ISO build/test scripts. Two minor fixes inline: `nomarchy-build-iso` and `nomarchy-build-live-iso` both ran under `set -e` but then wrapped `nix build` in an `if [ $? -eq 0 ]` block — the `else` branch printing "Error: ISO build failed." was unreachable because `set -e` aborts before the conditional. Removed the dead branches (behaviour identical: the user sees `nix build`'s own error and the script exits). Regression-class check (`hardware-db.sh` precedent): cross-referenced every tool `install.sh` calls against the installer host's `environment.systemPackages` chain — `gptfdisk` (sgdisk) is provided by upstream `profiles/base.nix:21` which `installation-cd-base.nix` chains, `jq` is wrapped in the `nrun` nix-run fallback, and every other direct call (`wipefs`, `dd`, `parted`, `partprobe`, `cryptsetup`, `disko`, `nixos-{install,enter,rebuild}`, `loadkeys`, `timedatectl`, `nmtui`) resolves via either the explicit host packages or the standard base. `nomarchy-live` host shape verified: multi-GPU initrd modules + Xwayland video drivers cover both real hardware and QEMU; auto-login + passwordless sudo + helpful TTY MOTD + Hyprland on-boot exec to a terminal at the install command. `nomarchy-test-live-iso` walks four OVMF candidate paths with KVM detection. With this entry, every code-shaped audit in Pillar 8 has shipped (Components 1–10); the Now-column "Full QA audit" item moves out, replaced by a runtime-verification punch-list entry covering the cross-component "needs runtime verification" notes from each closeout. - _2026-05-21_ — **Pillar 8 / Component 8 (Scripts runtime behavior): closeout.** Code-review-shaped sweep over `features/scripts/utils/nomarchy-menu` (382 lines, 23 submenu functions), every script referenced from those submenus, the schema↔script field-name cross-check, and cross-cutting typo/stale-reference patterns. Four real fixes inline: **(1)** `nomarchy-menu:70` — "Learn → Nomarchy" still called `nomarchy-launch-webapp https://learn.omacom.io/2/the-nomarchy-manual` (an upstream Omarchy URL — the same one fixed in `nomarchy-manual` back on 2026-05-18). Now calls `nomarchy-manual`, which opens the local docs index. **(2)** `nomarchy-menu:179` — "Style → Hyprland" opened `~/.config/hypr/looknfeel.conf`, a path nothing deploys; the actual file lives at `~/.config/nomarchy/default/hypr/looknfeel.conf` (sourced via the chain from `nomarchy.conf`). Updated the path. **(3)** `nomarchy-menu:258` — `*Overrides*) xdg-open ~/.config/nomarchy/overrides/` case branch with no matching menu option, dead code anticipating the still-unimplemented `nomarchy.overrides.*` loader. Removed (will reappear with the option when the loader ships). **(4)** `nomarchy-theme-bg-next:12` — `jq -r '.theme // "nord"'` defaulted to `"nord"` if `.theme` was missing, while `lib/state-schema.nix:17` defines `"summer-night"` as the schema default. On a fresh-or-empty `state.json` the script looked for backgrounds under `palettes/nord/` while the rest of the system treated `summer-night` as active. Matched to the schema default. Cross-cutting sweeps came back clean: no `$NN[A-Z]+` env var typos elsewhere (the prior pair fixed in `40b6212` was the lot), no references to scripts deleted in earlier Pillar 3 batches (`nomarchy-restart-{hyprctl,mako,tmux}`, `nomarchy-battery-present`, `nomarchy-sudo-keepalive`, `nomarchy-rollback`, `nomarchy-snapshot`, `nomarchy-migrate-state`, `nomarchy-config-direct-boot`, `nomarchy-npx-install`, `nomarchy-webapp-handler-{hey,zoom}`), no stray `omarchy`/`omacom` strings outside historical roadmap entries, and every `state.json` field-write resolves against `lib/state-schema.nix` (or the documented off-schema `welcome_done`). One UX-shaped pattern bug logged separately to Later: `show_setup_config_menu` edits Nix-managed files that get clobbered on the next `home-manager switch`. Runtime verification (run every user-visible menu entry and confirm it does the thing) remains on the user. diff --git a/docs/creating-themes.md b/docs/creating-themes.md index 2c5bca1..17af5d3 100644 --- a/docs/creating-themes.md +++ b/docs/creating-themes.md @@ -175,17 +175,26 @@ decoration { ## Step 6: Template Variables -Nomarchy has a template system that generates app configs from your `colors.toml`. Templates in `themes/templates/*.tpl` use placeholder syntax: +Nomarchy has a small template system that generates per-palette files from your `colors.toml` at `nomarchy-theme-set` time. Templates in `themes/templates/*.tpl` use placeholder syntax: -| Syntax | Example Value | Description | -|---------------------|---------------|--------------------------------| -| `{{ background }}` | `#2d353b` | Color value as-is (with `#`) | -| `{{ background_strip }}` | `2d353b` | Color value without `#` | -| `{{ background_rgb }}` | `45,53,59` | Color as decimal RGB | +| Syntax | Example Value | Description | +|-------------------------|---------------|------------------------------| +| `{{ background }}` | `#2d353b` | Color value as-is (with `#`) | +| `{{ background_strip }}`| `2d353b` | Color value without `#` | +| `{{ background_rgb }}` | `45,53,59` | Color as decimal RGB | -Every key from `colors.toml` is available as a template variable. Templates are processed automatically by `nomarchy-theme-set-templates` when switching themes. +Every key from `colors.toml` is available as a template variable. The script (`nomarchy-theme-set-templates`) processes each template into `~/.config/nomarchy/current/theme/` only when no file is already there — so it acts as a fallback for palettes that don't ship the file themselves. -To add custom templates, place `.tpl` files in `~/.config/nomarchy/themed/`. User templates take priority over built-in ones. +Two built-in templates ship: + +| Template | Output | Consumed by | +|---------------------|------------------------------------------------|-----------------------------------------------------------------------------| +| `obsidian.css.tpl` | `~/.config/nomarchy/current/theme/obsidian.css` | `nomarchy-theme-set-obsidian` copies it into every Obsidian vault | +| `keyboard.rgb.tpl` | `~/.config/nomarchy/current/theme/keyboard.rgb` | `nomarchy-theme-set-keyboard-asus-rog` calls `asusctl aura effect static` | + +Everything else that used to ship a template (`alacritty.toml.tpl`, `btop.theme.tpl`, `chromium.theme.tpl`, `ghostty.conf.tpl`, `hyprland.conf.tpl`, `hyprlock.conf.tpl`, `kitty.conf.tpl`, `swayosd.css.tpl`, `hyprland-preview-share-picker.css.tpl`) has been removed: those apps are themed via Stylix, declarative Home-Manager options, or per-palette Nix generators in `themes/engine/files.nix` — the template path was always shadowed by an earlier write. + +To add a custom template, drop a `.tpl` file in `~/.config/nomarchy/themes/templates/`. User templates take priority over built-in ones. ## Step 7: Preview Image (Optional) diff --git a/themes/templates/alacritty.toml.tpl b/themes/templates/alacritty.toml.tpl deleted file mode 100644 index ff8bc8d..0000000 --- a/themes/templates/alacritty.toml.tpl +++ /dev/null @@ -1,47 +0,0 @@ -[colors.primary] -background = "{{ background }}" -foreground = "{{ foreground }}" - -[colors.cursor] -text = "{{ background }}" -cursor = "{{ cursor }}" - -[colors.vi_mode_cursor] -text = "{{ background }}" -cursor = "{{ cursor }}" - -[colors.search.matches] -foreground = "{{ background }}" -background = "{{ color3 }}" - -[colors.search.focused_match] -foreground = "{{ background }}" -background = "{{ color1 }}" - -[colors.footer_bar] -foreground = "{{ background }}" -background = "{{ foreground }}" - -[colors.selection] -text = "{{ selection_foreground }}" -background = "{{ selection_background }}" - -[colors.normal] -black = "{{ color0 }}" -red = "{{ color1 }}" -green = "{{ color2 }}" -yellow = "{{ color3 }}" -blue = "{{ color4 }}" -magenta = "{{ color5 }}" -cyan = "{{ color6 }}" -white = "{{ color7 }}" - -[colors.bright] -black = "{{ color8 }}" -red = "{{ color9 }}" -green = "{{ color10 }}" -yellow = "{{ color11 }}" -blue = "{{ color12 }}" -magenta = "{{ color13 }}" -cyan = "{{ color14 }}" -white = "{{ color15 }}" diff --git a/themes/templates/btop.theme.tpl b/themes/templates/btop.theme.tpl deleted file mode 100644 index 7b1b299..0000000 --- a/themes/templates/btop.theme.tpl +++ /dev/null @@ -1,83 +0,0 @@ -# Main background, empty for terminal default, need to be empty if you want transparent background -theme[main_bg]="{{ background }}" - -# Main text color -theme[main_fg]="{{ foreground }}" - -# Title color for boxes -theme[title]="{{ foreground }}" - -# Highlight color for keyboard shortcuts -theme[hi_fg]="{{ accent }}" - -# Background color of selected item in processes box -theme[selected_bg]="{{ color8 }}" - -# Foreground color of selected item in processes box -theme[selected_fg]="{{ accent }}" - -# Color of inactive/disabled text -theme[inactive_fg]="{{ color8 }}" - -# Color of text appearing on top of graphs, i.e uptime and current network graph scaling -theme[graph_text]="{{ foreground }}" - -# Background color of the percentage meters -theme[meter_bg]="{{ color8 }}" - -# Misc colors for processes box including mini cpu graphs, details memory graph and details status text -theme[proc_misc]="{{ foreground }}" - -# CPU, Memory, Network, Proc box outline colors -theme[cpu_box]="{{ color5 }}" -theme[mem_box]="{{ color2 }}" -theme[net_box]="{{ color1 }}" -theme[proc_box]="{{ accent }}" - -# Box divider line and small boxes line color -theme[div_line]="{{ color8 }}" - -# Temperature graph color (Green -> Yellow -> Red) -theme[temp_start]="{{ color2 }}" -theme[temp_mid]="{{ color3 }}" -theme[temp_end]="{{ color1 }}" - -# CPU graph colors (Teal -> Lavender) -theme[cpu_start]="{{ color6 }}" -theme[cpu_mid]="{{ color4 }}" -theme[cpu_end]="{{ color5 }}" - -# Mem/Disk free meter (Mauve -> Lavender -> Blue) -theme[free_start]="{{ color5 }}" -theme[free_mid]="{{ color4 }}" -theme[free_end]="{{ color6 }}" - -# Mem/Disk cached meter (Sapphire -> Lavender) -theme[cached_start]="{{ color4 }}" -theme[cached_mid]="{{ color6 }}" -theme[cached_end]="{{ color5 }}" - -# Mem/Disk available meter (Peach -> Red) -theme[available_start]="{{ color3 }}" -theme[available_mid]="{{ color1 }}" -theme[available_end]="{{ color1 }}" - -# Mem/Disk used meter (Green -> Sky) -theme[used_start]="{{ color2 }}" -theme[used_mid]="{{ color6 }}" -theme[used_end]="{{ color4 }}" - -# Download graph colors (Peach -> Red) -theme[download_start]="{{ color3 }}" -theme[download_mid]="{{ color1 }}" -theme[download_end]="{{ color1 }}" - -# Upload graph colors (Green -> Sky) -theme[upload_start]="{{ color2 }}" -theme[upload_mid]="{{ color6 }}" -theme[upload_end]="{{ color4 }}" - -# Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve) -theme[process_start]="{{ color6 }}" -theme[process_mid]="{{ color4 }}" -theme[process_end]="{{ color5 }}" diff --git a/themes/templates/chromium.theme.tpl b/themes/templates/chromium.theme.tpl deleted file mode 100644 index 84059b2..0000000 --- a/themes/templates/chromium.theme.tpl +++ /dev/null @@ -1 +0,0 @@ -{{ background_rgb }} diff --git a/themes/templates/ghostty.conf.tpl b/themes/templates/ghostty.conf.tpl deleted file mode 100644 index bafc649..0000000 --- a/themes/templates/ghostty.conf.tpl +++ /dev/null @@ -1,22 +0,0 @@ -background = {{ background }} -foreground = {{ foreground }} -cursor-color = {{ cursor }} -selection-background = {{ selection_background }} -selection-foreground = {{ selection_foreground }} - -palette = 0={{ color0 }} -palette = 1={{ color1 }} -palette = 2={{ color2 }} -palette = 3={{ color3 }} -palette = 4={{ color4 }} -palette = 5={{ color5 }} -palette = 6={{ color6 }} -palette = 7={{ color7 }} -palette = 8={{ color8 }} -palette = 9={{ color9 }} -palette = 10={{ color10 }} -palette = 11={{ color11 }} -palette = 12={{ color12 }} -palette = 13={{ color13 }} -palette = 14={{ color14 }} -palette = 15={{ color15 }} diff --git a/themes/templates/hyprland-preview-share-picker.css.tpl b/themes/templates/hyprland-preview-share-picker.css.tpl deleted file mode 100644 index 07e5e4e..0000000 --- a/themes/templates/hyprland-preview-share-picker.css.tpl +++ /dev/null @@ -1,94 +0,0 @@ -@define-color foreground {{ foreground }}; -@define-color background {{ background }}; -@define-color accent {{ accent }}; -@define-color muted {{ color8 }}; -@define-color card_bg {{ color0 }}; -@define-color text_dark {{ background }}; -@define-color accent_hover {{ color12 }}; -@define-color selected_tab {{ accent }}; -@define-color text {{ foreground }}; - -* { - all: unset; - font-family: JetBrains Mono NF; - color: @foreground; - font-weight: bold; - font-size: 16px; -} - -.window { - background: alpha(@background, 0.95); - border: solid 2px @accent; - margin: 4px; - padding: 18px; -} - -tabs { - padding: 0.5rem 1rem; -} - -tabs > tab { - margin-right: 1rem; -} - -.tab-label { - color: @text; - transition: all 0.2s ease; -} - -tabs > tab:checked > .tab-label, tabs > tab:active > .tab-label { - text-decoration: underline currentColor; - color: @selected_tab; -} - -tabs > tab:focus > .tab-label { - color: @foreground; -} - -.page { - padding: 1rem; -} - -.image-label { - font-size: 12px; - padding: 0.25rem; -} - -flowboxchild > .card, button > .card { - transition: all 0.2s ease; - border: solid 2px transparent; - border-color: @background; - border-radius: 5px; - background-color: @card_bg; - padding: 5px; -} - -flowboxchild:hover > .card, button:hover > .card, flowboxchild:active > .card, flowboxchild:selected > .card, button:active > .card, button:selected > .card, button:focus > .card { - border: solid 2px @accent; -} - -.image { - border-radius: 5px; -} - -.region-button { - padding: 0.5rem 1rem; - border-radius: 5px; - background-color: @accent; - color: @text_dark; - transition: all 0.2s ease; -} - -.region-button > label { - color: @text_dark; -} - -.region-button:not(:disabled):hover, .region-button:not(:disabled):focus { - background-color: @accent_hover; - color: @text_dark; -} - -.region-button:disabled { - background-color: @muted; - color: @background; -} diff --git a/themes/templates/hyprland.conf.tpl b/themes/templates/hyprland.conf.tpl deleted file mode 100644 index e4dbf3c..0000000 --- a/themes/templates/hyprland.conf.tpl +++ /dev/null @@ -1,9 +0,0 @@ -$activeBorderColor = rgb({{ accent_strip }}) - -general { - col.active_border = $activeBorderColor -} - -group { - col.border_active = $activeBorderColor -} diff --git a/themes/templates/hyprlock.conf.tpl b/themes/templates/hyprlock.conf.tpl deleted file mode 100644 index 1b4cac3..0000000 --- a/themes/templates/hyprlock.conf.tpl +++ /dev/null @@ -1,5 +0,0 @@ -$color = rgba({{ background_rgb }}, 1.0) -$inner_color = rgba({{ background_rgb }}, 0.8) -$outer_color = rgba({{ foreground_rgb }}, 1.0) -$font_color = rgba({{ foreground_rgb }}, 1.0) -$check_color = rgba({{ accent_rgb }}, 1.0) diff --git a/themes/templates/kitty.conf.tpl b/themes/templates/kitty.conf.tpl deleted file mode 100644 index e74a5bb..0000000 --- a/themes/templates/kitty.conf.tpl +++ /dev/null @@ -1,27 +0,0 @@ -foreground {{ foreground }} -background {{ background }} -selection_foreground {{ selection_foreground }} -selection_background {{ selection_background }} - -cursor {{ cursor }} -cursor_text_color {{ background }} - -active_border_color {{ accent }} -active_tab_background {{ accent }} - -color0 {{ color0 }} -color1 {{ color1 }} -color2 {{ color2 }} -color3 {{ color3 }} -color4 {{ color4 }} -color5 {{ color5 }} -color6 {{ color6 }} -color7 {{ color7 }} -color8 {{ color8 }} -color9 {{ color9 }} -color10 {{ color10 }} -color11 {{ color11 }} -color12 {{ color12 }} -color13 {{ color13 }} -color14 {{ color14 }} -color15 {{ color15 }} diff --git a/themes/templates/swayosd.css.tpl b/themes/templates/swayosd.css.tpl deleted file mode 100644 index e06402c..0000000 --- a/themes/templates/swayosd.css.tpl +++ /dev/null @@ -1,5 +0,0 @@ -@define-color background-color {{ background }}; -@define-color border-color {{ foreground }}; -@define-color label {{ foreground }}; -@define-color image {{ foreground }}; -@define-color progress {{ accent }};