Noctalia/matugen theme template is never rendered: placeholder in comment #1

Closed
opened 2026-11-13 08:59:15 +01:00 by tylerstyle · 1 comment
tylerstyle commented 2026-11-13 08:59:15 +01:00 (Migrated from github.com)

Tested on NixOS with Noctalia v5.4.1 at 0dd9b67.

Bug

The header comment of contrib/themes/noctalia.toml contains a literal {{colors.<name>.default.hex}}. Noctalia renders placeholders in comments too, can't resolve <name>, and refuses to write the output:

template_engine: failed to render template …/matrix-rat.toml -> …: 1 template error(s); output not written

So ~/.config/matrix-rat/themes/noctalia.toml is never created. matugen uses the same file, so it's likely affected too (not tested here).

Fix: remove the braces from that comment. Tested locally: Noctalia then renders the theme (noctalia msg templates-apply), and cargo test still passes (103 passed, 2 ignored).

-# matrix-rat theme template for Noctalia (v5 and v4) and for matugen — they share the
-# {{colors.<name>.default.hex}} syntax. See contrib/themes/README.md for how to register it.
+# matrix-rat theme template for Noctalia (v5 and v4) and for matugen, which share the same
+# colors.<name>.default.hex placeholder syntax. See contrib/themes/README.md for how to register it.
+# Do not write a literal placeholder in these comments: Noctalia renders comments too.

Docs

contrib/themes/README.md uses matrix-rat --print-template / --reload-theme but never says how to install the program. post_hook runs inside Noctalia's own environment, so it needs an absolute path, or cargo install --path . with ~/.cargo/bin on PATH. $XDG_CONFIG_HOME paths work even when the variable is unset (Noctalia falls back to ~/.config).

Tooling

scripts/check.sh assumes rustfmt and clippy are installed. shell.nix doesn't provide them, and clippy must match the system rustc exactly (mixing 1.97/1.99 fails with E0514).

Results here

fmt ✓, clippy (1.99.1) ✓ 0 warnings, tests (1.97.1) 103 passed / 2 ignored, build ✓.

🤖 Generated with Claude Code

Tested on NixOS with Noctalia v5.4.1 at `0dd9b67`. ### Bug The header comment of `contrib/themes/noctalia.toml` contains a literal `{{colors.<name>.default.hex}}`. Noctalia renders placeholders in comments too, can't resolve `<name>`, and refuses to write the output: ``` template_engine: failed to render template …/matrix-rat.toml -> …: 1 template error(s); output not written ``` So `~/.config/matrix-rat/themes/noctalia.toml` is never created. matugen uses the same file, so it's likely affected too (not tested here). **Fix:** remove the braces from that comment. Tested locally: Noctalia then renders the theme (`noctalia msg templates-apply`), and `cargo test` still passes (103 passed, 2 ignored). ```diff -# matrix-rat theme template for Noctalia (v5 and v4) and for matugen — they share the -# {{colors.<name>.default.hex}} syntax. See contrib/themes/README.md for how to register it. +# matrix-rat theme template for Noctalia (v5 and v4) and for matugen, which share the same +# colors.<name>.default.hex placeholder syntax. See contrib/themes/README.md for how to register it. +# Do not write a literal placeholder in these comments: Noctalia renders comments too. ``` ### Docs `contrib/themes/README.md` uses `matrix-rat --print-template` / `--reload-theme` but never says how to install the program. `post_hook` runs inside Noctalia's own environment, so it needs an absolute path, or `cargo install --path .` with `~/.cargo/bin` on PATH. `$XDG_CONFIG_HOME` paths work even when the variable is unset (Noctalia falls back to `~/.config`). ### Tooling `scripts/check.sh` assumes `rustfmt` and `clippy` are installed. `shell.nix` doesn't provide them, and clippy must match the system `rustc` exactly (mixing 1.97/1.99 fails with E0514). ### Results here fmt ✓, clippy (1.99.1) ✓ 0 warnings, tests (1.97.1) 103 passed / 2 ignored, build ✓. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tylerstyle commented 2026-11-13 09:11:19 +01:00 (Migrated from github.com)

Taken in with dd24771:

  • Template: the placeholder is gone from the header comment, as in your diff. A test now fails if any generator template has a brace in a comment.
  • Docs: the main README has an install section; contrib/themes/README.md explains that post_hook runs in Noctalia's environment (PATH or full path), that it is optional because of the file watcher, and the $XDG_CONFIG_HOME fallback. The Noctalia template is marked as tested with v5.4.1.
  • Tooling: shell.nix now provides rustc, cargo, clippy and rustfmt from one nixpkgs, so they always match; nix-shell --run scripts/check.sh is the documented way to run the check. Verified here that the shell gives rustc 1.99.1 / clippy 0.1.99.

matugen, wallust and pywal remain untested against the real tools.

Taken in with dd24771: - **Template:** the placeholder is gone from the header comment, as in your diff. A test now fails if any generator template has a brace in a comment. - **Docs:** the main README has an install section; `contrib/themes/README.md` explains that `post_hook` runs in Noctalia's environment (PATH or full path), that it is optional because of the file watcher, and the `$XDG_CONFIG_HOME` fallback. The Noctalia template is marked as tested with v5.4.1. - **Tooling:** `shell.nix` now provides rustc, cargo, clippy and rustfmt from one nixpkgs, so they always match; `nix-shell --run scripts/check.sh` is the documented way to run the check. Verified here that the shell gives rustc 1.99.1 / clippy 0.1.99. matugen, wallust and pywal remain untested against the real tools.
Sign in to join this conversation.
No description provided.