#73 dynamic color scheme presets from .txt palettes + shell restart command #92

Merged
zach merged 13 commits from 73-colorscheme-options into main 2026-05-23 20:15:30 +02:00
Collaborator

Description

Replace hardcoded MaterialYou seed-based color PRESETS dict with a dynamic
directory-scanning scheme system. The wallpaper auto mode (which uses MaterialYou
seed generation from images) is untouched.

schemepalettes.py

  • Remove old SeedPalette dataclass + PRESETS dict (hardcoded Hct seeds)
  • Scan assets/schemes/ for .txt palette files; no JSON descriptors needed
  • Support per-accent files via {accent}-{mode}.txt naming pattern
  • Expose 13 schemes with 27+ variants; catppuccin has 14 accents × 4 flavors

Catppuccin color correction

  • Update mocha/macchiato/frappe/latte .txt colors from dankmaterialshell data
  • Generate 56 per-accent .txt files (rosewater through lavender)

scheme.py CLI

  • Load .txt palettes directly for presets, bypassing MaterialYou
  • Add list-presets command (human + --json output)
  • --preset <scheme>:<variant> selects a palette (removed :accent shorthand)
  • --accent <name> picks accent for schemes that support it (catppuccin only)
  • Validate --accent against variant's available accents; reject invalid with clear error
  • JSON output includes default_accent per variant so QML UI can pre-select
  • Auto/wallpaper path still uses MaterialYou seeds (unchanged)

shell.py

  • Add restart command (kill + start)
  • Fix call command crash when no method args given

Cleanup

  • Remove dead preset.py/record.py stubs
  • Delete catppuccin.py + catppuccin.json (replaced by .txt files)
  • Strip all comments from modified Python files

Tests

  • 22 tests for schemepalettes (parse, discover, palette loading, accent fallback, resolve_preset)
  • 10 tests for shell (all commands mocked, restart verifies kill → start order)

Suggestions to add later

  • When automatic scheme mode is disabled, it still has the option to change
    scheme mode and scheme type. This can cause issues since that affects the
    preset color scheme. These options could be hidden when automatic scheme mode
    is disabled, optionally revealing the palette options instead.
  • With the above, I am not sure hiding palette in the first place is the right
    approach. Maybe a different implementation like a toggle between automatic vs
    palette is better?
## Description Replace hardcoded MaterialYou seed-based color `PRESETS` dict with a dynamic directory-scanning scheme system. The wallpaper auto mode (which uses MaterialYou seed generation from images) is untouched. ### `schemepalettes.py` - Remove old `SeedPalette` dataclass + `PRESETS` dict (hardcoded Hct seeds) - Scan `assets/schemes/` for `.txt` palette files; no JSON descriptors needed - Support per-accent files via `{accent}-{mode}.txt` naming pattern - Expose 13 schemes with 27+ variants; catppuccin has 14 accents × 4 flavors ### Catppuccin color correction - Update mocha/macchiato/frappe/latte `.txt` colors from dankmaterialshell data - Generate 56 per-accent `.txt` files (rosewater through lavender) ### `scheme.py` CLI - Load `.txt` palettes directly for presets, bypassing MaterialYou - Add `list-presets` command (human + `--json` output) - `--preset <scheme>:<variant>` selects a palette (removed `:accent` shorthand) - `--accent <name>` picks accent for schemes that support it (catppuccin only) - Validate `--accent` against variant's available accents; reject invalid with clear error - JSON output includes `default_accent` per variant so QML UI can pre-select - Auto/wallpaper path still uses MaterialYou seeds (unchanged) ### `shell.py` - Add `restart` command (kill + start) - Fix `call` command crash when no method args given ### Cleanup - Remove dead `preset.py`/`record.py` stubs - Delete `catppuccin.py` + `catppuccin.json` (replaced by `.txt` files) - Strip all comments from modified Python files ### Tests - 22 tests for schemepalettes (parse, discover, palette loading, accent fallback, resolve_preset) - 10 tests for shell (all commands mocked, restart verifies kill → start order) ## Suggestions to add later - When automatic scheme mode is disabled, it still has the option to change scheme mode and scheme type. This can cause issues since that affects the preset color scheme. These options could be hidden when automatic scheme mode is disabled, optionally revealing the palette options instead. - With the above, I am not sure hiding palette in the first place is the right approach. Maybe a different implementation like a toggle between automatic vs palette is better?
AramJonghu added the enhancement label 2026-05-22 23:24:26 +02:00
AramJonghu self-assigned this 2026-05-22 23:24:26 +02:00
AramJonghu added this to the Zshell board project 2026-05-22 23:24:26 +02:00
AramJonghu added 6 commits 2026-05-22 23:24:26 +02:00
- Catppuccin txt colors extracted from dankmaterialyou and created txt
  files for each.
- Preset is now an option and are exposed.
- Tests test presets, might add workflow to run tests.
added workflow running python tests
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Failing after 24s
Python / test (pull_request) Successful in 50s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m48s
f147969f37
AramJonghu requested review from Inorishio 2026-05-22 23:24:26 +02:00
AramJonghu requested review from zach 2026-05-22 23:24:26 +02:00
AramJonghu added 1 commit 2026-05-22 23:26:36 +02:00
format check and lint resolved
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 19s
Python / test (pull_request) Successful in 46s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m50s
0309fde3aa
Owner

Looks good overall, I have two things I wonder about:

  1. Isn't --accent redundant when the second colon is also for setting accent, or am I misunderstanding? However I do think if there is a difference between the [:accent] and --accent then we should probably rename either to avoid confusion.
  2. Some of the schemes have very little contrast, at least on my system. The m3surface and m3surfaceContainer colors are so similar I can barely tell they're different sometimes. We should probably change that at some point, but not necessary before merge I don't think.

image.png
image.png

Looks good overall, I have two things I wonder about: 1. Isn't `--accent` redundant when the second colon is also for setting accent, or am I misunderstanding? However I do think if there is a difference between the `[:accent]` and `--accent` then we should probably rename either to avoid confusion. 2. Some of the schemes have very little contrast, at least on my system. The `m3surface` and `m3surfaceContainer` colors are so similar I can barely tell they're different sometimes. We should probably change that at some point, but not necessary before merge I don't think. ![image.png](/attachments/403c2c52-b255-4f4c-bfa4-b6eedc3df5cd) ![image.png](/attachments/9fa4e755-83fb-4a3b-bafe-eba714f585eb)
AramJonghu added 1 commit 2026-05-23 00:42:31 +02:00
removal of plans package/directory (we have project board now)
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 22s
Python / test (pull_request) Successful in 49s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
7c29921a6b
Author
Collaborator

Agreed, not a huge fan of the surfaces and the container colors.

--accent is reduntant. Probably AI moment and me not checking thoroughly. Will resolve in next commit.

Agreed, not a huge fan of the surfaces and the container colors. `--accent` is reduntant. Probably AI moment and me not checking thoroughly. Will resolve in next commit.
AramJonghu added 1 commit 2026-05-23 00:51:18 +02:00
--accent removed. Accidental inclusion
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 22s
Python / test (pull_request) Successful in 46s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m46s
2934d863ca
Author
Collaborator

@zach Resolved.

@zach Resolved.
AramJonghu moved this to In Progress in Zshell board on 2026-05-23 01:04:06 +02:00
AramJonghu removed this from the Zshell board project 2026-05-23 01:04:18 +02:00
AramJonghu added 1 commit 2026-05-23 17:46:02 +02:00
scheme: add --json flag to list-presets, --accent flag, drop :accent from preset spec
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 13s
Python / lint-format (pull_request) Successful in 25s
Python / test (pull_request) Successful in 44s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m48s
21ed178bbc
- list-presets --json outputs structured JSON with variants,
  modes, accents, and default_accent for accent-aware schemes
- --accent flag replaces :accent shorthand in preset string
- Validate --accent against variant's available accents
- resolve_preset returns tuple[str, str] (scheme + variant only)
- Update tests for new signature
AramJonghu added 2 commits 2026-05-23 17:53:21 +02:00
documentation in README.md added
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 23s
Python / test (pull_request) Successful in 50s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m50s
5df46160f6
zach added 1 commit 2026-05-23 20:14:15 +02:00
Settings UI for color scheme presets
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 25s
Python / test (pull_request) Successful in 53s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m52s
96afbdb30b
zach merged commit ad57764636 into main 2026-05-23 20:15:30 +02:00
AramJonghu deleted branch 73-colorscheme-options 2026-05-23 21:07:55 +02:00
Sign in to join this conversation.