diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-12 10:55:59 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-12 10:55:59 +0200 |
| commit | d18d5ae92912e49334b17024454ac1f5a9f059d9 (patch) | |
| tree | d1e77709f5c4c9050cd3ed4e80e460597f395da4 | |
| parent | 8b8731e089575a4bf3b9b308e26b38f4dad47511 (diff) | |
| download | unified-desktop-theme-d18d5ae92912e49334b17024454ac1f5a9f059d9.tar.gz unified-desktop-theme-d18d5ae92912e49334b17024454ac1f5a9f059d9.zip | |
fix(palette): emit waybar's Catppuccin names from roles
styles/main.css and styles/global.css are edited in place, not generated,
and reference nineteen colours by Catppuccin name: @surface1, @text,
@crust, @lavender and the rest. gen_waybar emitted only the role layer
plus the scheme's own palette names, which happen to include those names
under the four Catppuccin schemes and none of the other five.
Under tokyo-night every one of those references was undefined, GTK fell
back to a default, and the separators in main.css went from a dim
alpha(@surface1, 0.4) hairline to full brightness. The workspace
underline, the bluetooth, mail and breaktimer state colours and the
tooltip border were falling back the same way.
Emit them from roles, reusing the ROFI_NAMES table that exists because
rofi had this exact bug; mauve is the one name waybar uses that rofi
does not, and maps to the highlight role.
Verified across all nine schemes: every referenced name now resolves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176XsV85ByN2ee7HseUKcqA
| -rwxr-xr-x | bin/udt-palette | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bin/udt-palette b/bin/udt-palette index f2807af..a746766 100755 --- a/bin/udt-palette +++ b/bin/udt-palette @@ -150,8 +150,15 @@ def gen_waybar(res, scheme, palette): """waybar: one file holding the palette and the role layer. Both halves together because style.css imports a single themes/<scheme>.css, - and the stylesheets reference names from each: @lavender and @surface1 from - the palette, @cpu and @hover-bg from the roles. + and the stylesheets reference names from each: @lavender and @surface1 by + Catppuccin name, @cpu and @hover-bg by role. + + The Catppuccin-named half is emitted from roles, exactly as gen_rofi does + and for the same reason: styles/main.css and styles/global.css are edited + in place, not generated, and ask for @surface1 and @text outright. Tokyo + Night calls those surface_alt and fg, so emitting only the scheme's own + palette names left every such reference dangling and GTK fell back to a + default, which is how the bar's separators went bright. Role names keep their existing hyphenated spelling (main-bg, not main_bg): the stylesheets reference them and are not generated. @@ -159,6 +166,12 @@ def gen_waybar(res, scheme, palette): palette_rows = "\n".join(f"@define-color {k:<12}{v};" for k, v in sorted(palette.items())) + # The names the hand-edited stylesheets reference. ROFI_NAMES already maps + # most of them; mauve is the one waybar uses and rofi does not. + compat_rows = "\n".join( + f"@define-color {name:<12}{rgba(res[role])};" + for name, role in [*ROFI_NAMES, ("mauve", "highlight")]) + def emit(role, css_name=None): c = res[role] return f"@define-color {(css_name or role.replace('_', '-')):<12}{rgba(c)};" @@ -173,6 +186,9 @@ def gen_waybar(res, scheme, palette): "", palette_rows, "", + "/* Catppuccin names, from roles: the hand-edited stylesheets use these. */", + compat_rows, + "", "/* br - border, bg - background, fg - foreground */", "", "/* main colors */", |
