Skip to content

fix(theme): keep the live mode and Dreamcoder colours stable across mode switches - #13

Merged
Dreamcoder08 merged 7 commits into
mainfrom
pr/03-theme-mode-and-listener
Sep 29, 2026
Merged

Dreamcoder08 merged 7 commits into
mainfrom
pr/03-theme-mode-and-listener

Conversation

@Dreamcoder08

@Dreamcoder08 Dreamcoder08 commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

A bare dreamcoder sync rendered Dark over a Light system, ML4W's GTK listener re-ran Matugen over Dreamcoder colours on every switch, and a few apply steps hung or were silently undone.

Changes

  • theme_mode() falls back to the persisted live mode before defaulting to dark; fish starts in that mode
  • Marked hook in ML4W's gtk-theme-switcher.sh that re-applies Dreamcoder colours right after each Matugen run
  • restart_waybar detaches the relaunched bar from the caller's streams (theme apply no longer hangs)
  • btop color_theme re-selected on every apply
  • ls colours for broken links and sticky dirs lifted to WCAG AA, with a 4.5:1 gate test

Verification

New tests for each behaviour (mode resolution, listener fixture copied from ML4W 2.16, waybar detach, contrast gate); full suites green; a real dark to light toggle on a live machine leaves Starship, Hyprland and Waybar in Light.

Chain Context

Field Value
Chain ML4W 2.16 + Herdr 0.9.1 + Light/Dark-only stabilisation
Tracker PR Not needed (stacked PRs to main)
Position 3 of 6
Base pr/02-stow-herdr-0.9.1
Depends on #12
Follow-up #14
Review budget 669 / 400
Starts at the tip of pr/02-stow-herdr-0.9.1
Ends with fix(theme): keep the live mode and Dreamcoder colours stable across mode switches

Chain Overview

main
 └── #11 fix(ml4w)
  └── #12 fix(install)
   └── 📍 #13 fix(theme)
    └── #14 fix(shell)
     └── #15 refactor(theme)
      └── #16 chore(quality)

Scope

  • Includes: see Changes above
  • Excludes:
  • Shell option safety (PR 4)

Autonomy

  • CI is expected to pass for this PR branch
  • This PR has one deliverable scope
  • This PR can be rolled back without unrelated changes
  • Tests, docs, or manual verification cover this unit

restart_waybar left the new bar holding the caller's stdout, so theme apply (captured by Python or
systemd) never returned.
ML4W upgrades reset btop.conf color_theme to matugen; nothing restored it.
theme_mode() only read DREAMCODER_THEME_MODE and defaulted to dark, so a bare dreamcoder sync
(hooks, listeners, shells without the export) rendered Dreamcoder Dark over a system running Light.
Fall back to ~/.cache/dreamcoder/cursor-cli.env, the record every mode switch writes, before the
dark default.
05-dreamcoder-theme.fish trusted an inherited DREAMCODER_THEME_MODE (or assumed dark), so panes from
a long-lived parent opened with dark LS_COLORS/EZA_COLORS over the Light terminal until the first
prompt.
or rendered text on the warning swatch (2.09:1 light, 1.34:1 dark) and st used surface1 (4.31:1
light). Invert or onto the base bg and move st to surface0; a test now gates every LS_COLORS entry
at 4.5:1 in Light and Dark.
…matugen

ML4W 2.16's gtk-theme-switcher listener re-runs Matugen over the wallpaper on every gtk settings.ini
change, including Dreamcoder's own mode switch, and overwrites Dreamcoder colour files before
reloading Quickshell, Waybar, GTK and swaync. apply-ml4w-hooks.sh now inserts a marked block after
each Matugen call that runs dreamcoder sync synchronously in the branch's mode (repo writes off,
logged, bounded), and restarts the listener through listeners.sh when the file changes. Records T6
evidence and T8 in the feature document.
@Dreamcoder08

Copy link
Copy Markdown
Owner Author

Verified independently at this slice tip (stacked PRs do not run CI until retargeted to main): pytest exit 0, ruff clean, bats 1 failure. The single bats failure is apply-theme-mode.sh kanagawa bridge carries night-derived colors, which already fails on main; it is removed together with Night in #15 (bats 0 failures there).

@Dreamcoder08
Dreamcoder08 changed the base branch from pr/02-stow-herdr-0.9.1 to main September 29, 2026 20:44
@Dreamcoder08 Dreamcoder08 reopened this Sep 29, 2026
@Dreamcoder08
Dreamcoder08 merged commit ec67c6d into main Sep 29, 2026
12 of 13 checks passed
@Dreamcoder08
Dreamcoder08 deleted the pr/03-theme-mode-and-listener branch September 29, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant