Repository navigation
fix(ml4w): stop Matugen from writing the colour files Dreamcoder owns - #20
Merged
Merged
Conversation
Matugen rewrites hypr/colors.conf, hypr/colors.lua, waybar/colors.css, rofi/colors.rasi and (through a symlink into waybar) swaync/colors.css on every wallpaper or mode change. Restoring the colours afterwards is a race that can be lost: after a dark to light switch the files ended up as Matugen output even though the restore hook had run. Disable those five template sections in matugen/config.toml with a reversible, idempotent marker; other templates keep running. Also harden the script: - leave the Matugen config untouched when it cannot be validated as TOML - skip the listener hook and restart with a warning when timeout(1) is missing - shell-escape (printf %q) every path embedded in the generated runner, listener and waypaper commands, replace the waypaper sed with awk + ENVIRON, and validate the wallpaper variable name; a test runs the generated blocks with a hostile path and checks nothing is executed - fail with a clear message when lib/env.sh is missing Tests use a stock 2.16 fixture, and the isolation variables are now exported plus guarded by a test: a run that reached the live config once left the real wallpaper runner pointing at a deleted temp path.
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.
After a dark to light switch on a live ML4W 2.16 machine,
waybar/colors.cssandhypr/colors.confended up as Matugen output even though the restore hook had run: restoring colours after Matugen is a race that can be lost.Fix at the source. Disable the five Matugen templates whose output Dreamcoder owns (
hyprland,hyprland-lua,waybar,rofi,swaync, the last one writing through a symlink intowaybar/colors.css) inmatugen/config.toml, with a reversible, idempotent#dreamcoder-off#marker. The result is validated as TOML before it is written; every other template keeps running. ML4W upgrades restore the stock file, sodreamcoder repairre-applies it. Verified live: a real dark to light toggle leaves all four files as Dreamcoder colours andverify-ml4w-setup.shreports 23 passed / 0 failed.Hardening of
apply-ml4w-hooks.sh(raised by the GGA review, now running on gpt-6.1-sol):printf %q; the waypapersedbecomesawk+ENVIRON; the wallpaper variable name is validatedtimeout(1)is missinglib/env.shis missingTests (bats 165+ all ok): a stock 2.16 Matugen fixture, idempotency, re-disable after an upgrade, and a hostile dots path (quotes,
$(...), backticks,|,&, backslash) whose generated blocks are executed to prove nothing injected runs. The suite's isolation variables are now exported and guarded by a test: a run that reached the live config once left the real wallpaper runner pointing at a deleted temp path (repaired).