aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/udt-palette20
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 */",