diff options
| author | Saiyed Shizain <saiyedshizain@gmail.com> | 2026-09-11 23:53:29 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-11 23:53:29 +0530 |
| commit | 8672d041bec1a3c80da95adbfb5d0f974a97f84b (patch) | |
| tree | 41c5a0e5e6bcf13b1aa895ab3260a471824d4901 /README.md | |
| parent | 978bdc8d8a1a4dd50e1f539d89764a44d995a2d2 (diff) | |
| parent | b885efbf21f2839318a46e484654e706821b716e (diff) | |
| download | pomoru-1.2.0.tar.xz pomoru-1.2.0.zip | |
Merge pull request #9 from RanXom/feat/hot-reload-themev1.2.0
Feat/hot-reload-theme: Noctalia v5 (matugen) theming support & smooth hot-reloading
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 84 |
1 files changed, 83 insertions, 1 deletions
@@ -32,7 +32,7 @@ A minimalist Pomodoro TUI with a task list, written in Rust. - Keyboard-only interaction - Minimalist interface -- Dynamic theming system (for Noctalia Shell users) +- Dynamic theming via [Noctalia](https://noctalia.dev) (v5 matugen templates + legacy `colors.json`) - Configuration saved locally --- @@ -146,6 +146,88 @@ The previously stated `status.json` can be used in Waybar as follows: --- +## Theming + +Pomoru picks up colors in this priority order: + +| Priority | Source | When it applies | +|----------|--------|-----------------| +| 1 | `~/.cache/pomoru/colors.json` | Noctalia v5 user template (recommended) | +| 2 | `~/.config/noctalia/colors.json` | Legacy noctalia v4 format | +| 3 | Built-in defaults | Catppuccin Mocha palette | + +### Noctalia v5 — wiring it up + +Noctalia v5 uses its own template engine (matugen-compatible `{{colors.<role>.default.hex}}` tokens). When the wallpaper or palette changes, noctalia re-renders all configured templates automatically. Pomoru ships the template and config snippet needed to hook into this system. + +**One-time setup:** + +```bash +# 1. Copy the input template into noctalia's template directory +mkdir -p ~/.config/noctalia/templates +cp assets/noctalia/colors-template.json \ + ~/.config/noctalia/templates/pomoru-colors.json + +# 2. Register the user template in noctalia's config +# Either append to an existing templates.toml, or create it fresh: +cat assets/noctalia/templates.toml >> ~/.config/noctalia/templates.toml + +# 3. Render immediately (no need to change wallpaper) +noctalia msg templates-apply +``` + +After step 3, `~/.cache/pomoru/colors.json` will exist and pomoru picks it +up on the next launch. + +**What noctalia renders** (`assets/noctalia/colors-template.json`): + +```json +{ + "primary": "{{colors.primary.default.hex}}", + "on_surface_variant": "{{colors.on_surface_variant.default.hex}}", + "surface_container": "{{colors.surface_container.default.hex}}", + "on_surface": "{{colors.on_surface.default.hex}}" +} +``` + +**The config block** (`assets/noctalia/templates.toml`) noctalia reads: + +```toml +[theme.templates.user.pomoru] +input_path = "$XDG_CONFIG_HOME/noctalia/templates/pomoru-colors.json" +output_path = "$XDG_CACHE_HOME/pomoru/colors.json" +``` + +> **Note:** `$XDG_CONFIG_HOME` defaults to `~/.config` and `$XDG_CACHE_HOME` +> defaults to `~/.cache`. Noctalia v5 expands these automatically. + +> **Coming from noctalia v4?** Delete the stale files from `~/.config/noctalia/`: +> - `colors.json` — not read by v5 +> - `user-templates.toml` — uses matugen's old `[templates.*]` schema; v5 will +> warn `templates: unknown section` and ignore it. The v5 schema is +> `[theme.templates.user.*]` in any `*.toml` under `~/.config/noctalia/`. + +**Validate your config:** + +```bash +noctalia config validate ~/.config/noctalia/templates.toml +# → ✓ Config is valid +``` + +**Re-apply without changing wallpaper:** + +```bash +noctalia msg templates-apply +``` + +### Legacy noctalia (v4) + +No setup required. If `~/.config/noctalia/colors.json` exists and +`~/.cache/pomoru/colors.json` does not, pomoru reads the legacy camelCase +format automatically. Delete it once you've set up the v5 template above. + +--- + ## Installation ### Prebuilt binary |