diff options
Diffstat (limited to 'bin/udt-palette')
| -rwxr-xr-x | bin/udt-palette | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/udt-palette b/bin/udt-palette index 18dc0b1..edde7f3 100755 --- a/bin/udt-palette +++ b/bin/udt-palette @@ -223,6 +223,28 @@ def gen_kitty(res, scheme, palette): return "\n".join(lines) + "\n" +KVANTUM_ROLES = ["bg", "bg_alt", "surface", "surface_alt", "surface_high", + "fg", "fg_dim", "fg_faint", "mid_high", "accent", + "accent_dim", "accent_bright", "highlight", "critical"] + + +def gen_kvantum(res, scheme, palette, template): + """Kvantum: substitute the palette into the widget theme. + + A Kvantum theme is a .kvconfig of colours and a .svg of widget artwork with + colours baked into the paths. Only the palette colours are placeholders; + the neutral greys in the SVG are shading and shadow, not theme colour, so + they are left exactly as upstream drew them. + + Derived from the catppuccin-macchiato-lavender theme, which is what this + desktop was already running by hand. + """ + out = template + for role in KVANTUM_ROLES: + out = out.replace(f"@{role.upper()}@", hex6(res[role])) + return out + + def gen_homepage(res, scheme, palette): """gethomepage: a custom.css overriding its ten-step colour ramp. @@ -414,6 +436,8 @@ TARGETS = [ ("templates/conky.conf", gen_conky, "templates/conky.conf.in"), ("bin/udt_colors.py", gen_accent_py, None), ("templates/homepage/custom.css", gen_homepage, None), + ("templates/kvantum/theme.kvconfig", gen_kvantum, "templates/kvantum/theme.kvconfig.in"), + ("templates/kvantum/theme.svg", gen_kvantum, "templates/kvantum/theme.svg.in"), ] |
