feat(zed): add Go-based module pipeline, cached generation, and variant support#98
Open
yukazakiri wants to merge 3 commits intosnowarch:devfrom
Open
feat(zed): add Go-based module pipeline, cached generation, and variant support#98yukazakiri wants to merge 3 commits intosnowarch:devfrom
yukazakiri wants to merge 3 commits intosnowarch:devfrom
Conversation
Add new Zed editor theme target configuration with support for Material You color generation. Refactor theme generator to improve color parsing robustness by validating hex colors, supporting multiple input sources (palette.json, terminal.json, SCSS), and adding fallback default terminal colors. Remove hardcoded syntax color configuration in favor of dynamic color handling.
Add input signature file to cache zed theme generation results and skip regeneration when inputs haven't changed. This improves performance by avoiding unnecessary theme rebuilds when source files remain unchanged. Introduce build_input_signature function that computes a checksum of all input files including color palette, scss, terminal config, template, and theme generator source. Store the signature in a lock file and compare on subsequent runs to determine if regeneration is needed.
3ddf203 to
857c333
Compare
Contributor
|
yayy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR moves Zed theme generation into the same module/target flow used by the rest of iNiR theming, and switches Zed generation to a Go implementation.
It also improves reliability and speed when wallpapers change by avoiding unnecessary regenerations and handling concurrent runs safely.
What Changed
scripts/colors/modules/31-zed.shscripts/colors/targets/zed.jsonscripts/colors/modules/30-editors.shscripts/colors/zed_themegen/main.goscripts/colors/targets/editors.jsonand.gitignorefor integration/runtime artifactsNew Theme Output
The generator now writes all of these in one file:
iNiR DarkiNiR LightiNiR Borderless DarkiNiR Borderless LightiNiR-alt DarkiNiR-alt LightLogic Behind The Implementation
Quick breakdown of the new flow:
31-zed.shruns only when Zed theming is enabled and Zed is installed.material_colors.scsspalette.json/colors.jsonterminal.jsondots/.config/matugen/templates/zed-colors.jsonscripts/colors/zed_themegen/main.goflock) prevents race conditions when multiple theme updates trigger at once.go runso updates still continue.Inside
main.go:zed-colors.jsontemplate placeholders.50%mix so syntax keeps familiar token contrast while still matching the active theme.Performance: Python vs Go
I benchmarked both generators locally using the same real generated inputs:
~/.local/state/quickshell/user/generated/material_colors.scss~/.local/state/quickshell/user/generated/palette.json~/.local/state/quickshell/user/generated/terminal.jsondots/.config/matugen/templates/zed-colors.jsonMethod:
/tmp/tmp/inir-zed-themegen)scripts/colors/zed/theme_generator.pyviapython3Results (lower is better):
Observed speedup:
One-time build cost:
So the tradeoff is: first compile can take a moment, but steady-state generation is much faster, and with input-signature skip logic we avoid unnecessary runs entirely when nothing changed.
Why This Approach
Testing
Steps to verify this works:
go.mod file not founderrors in logs.~/.config/zed/themes/ii-theme.jsonupdates only when inputs change.Checklist
Related
Closes #
Fixes #