aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-23 18:44:38 +0200
committerDanilo M. <danix@danix.xyz>2026-09-23 18:44:38 +0200
commitf0b0e9dbb9062c38b40cb6984be5dbc2ce12948a (patch)
tree4104866d5a5cb59f1ccf403eb30b30d3f057562c /bin
parent041edc485cd81b2c564cbcaa3eb425c9ed5520e4 (diff)
downloadunified-desktop-theme-f0b0e9dbb9062c38b40cb6984be5dbc2ce12948a.tar.gz
unified-desktop-theme-f0b0e9dbb9062c38b40cb6984be5dbc2ce12948a.zip
fix: theme KDE Frameworks apps off Plasma
kcalc rendered white under the dark Kvantum theme. Off Plasma, KStyleManager forces Breeze unless kdeglobals names a widgetStyle, and KColorSchemeManager applies BreezeLight unless kdeglobals names a colour scheme; qt6ct never forwards the portal's prefer-dark to Qt. Generate a udt.colors KColorScheme from the Kvantum roles, install it to ~/.local/share/color-schemes/, and point kdeglobals at it and at kvantum-dark. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/udt-palette44
1 files changed, 44 insertions, 0 deletions
diff --git a/bin/udt-palette b/bin/udt-palette
index fbe53e6..04451f7 100755
--- a/bin/udt-palette
+++ b/bin/udt-palette
@@ -404,6 +404,49 @@ def gen_kvantum(res, scheme, palette, template):
return out
+def gen_kde(res, scheme, palette):
+ """KDE Frameworks apps: a KColorScheme file, the same roles as Kvantum.
+
+ Off Plasma, KColorSchemeManager ignores the Qt style's palette and falls
+ back to BreezeLight unless kdeglobals names a scheme, which is how kcalc
+ ended up white under a dark Kvantum theme. install.sh points kdeglobals at
+ this file. Colours are r,g,b triplets; the accent is the scheme's own,
+ since these apps read it once at startup.
+ """
+ def rgb(role):
+ r, g, b, _ = res[role]
+ return f"{r},{g},{b}"
+
+ fg = {
+ "ForegroundNormal": "fg", "ForegroundInactive": "fg_dim",
+ "ForegroundActive": "accent", "ForegroundLink": "accent",
+ "ForegroundVisited": "accent_bright", "ForegroundNegative": "critical",
+ "ForegroundNeutral": "warning", "ForegroundPositive": "success",
+ "DecorationFocus": "accent", "DecorationHover": "accent",
+ }
+ sets = {
+ "Window": ("bg", "surface"),
+ "View": ("bg_alt", "bg"),
+ "Button": ("surface", "surface_alt"),
+ "Header": ("bg", "surface"),
+ "Tooltip": ("bg_alt", "surface"),
+ "Complementary": ("bg_alt", "surface"),
+ "Selection": ("accent", "accent_dim"),
+ }
+ out = [f"# {BANNER.format(scheme=scheme)}", "[General]",
+ "ColorScheme=udt", "Name=udt", ""]
+ for name, (bg, bg_alt) in sets.items():
+ roles = dict(fg, BackgroundNormal=bg, BackgroundAlternate=bg_alt)
+ if name == "Selection":
+ # Text on a solid accent fill, so it takes the dark end.
+ roles.update(ForegroundNormal="bg", ForegroundActive="bg",
+ ForegroundInactive="surface")
+ out.append(f"[Colors:{name}]")
+ out += [f"{k}={rgb(v)}" for k, v in sorted(roles.items())]
+ out.append("")
+ return "\n".join(out)
+
+
# Shades upstream computed from a palette colour rather than taking one. Each
# paints exactly one widget surface, so leaving them literal (the rule that is
# right for the neutral greys) left twelve lavender and Macchiato-tinted spots
@@ -700,6 +743,7 @@ TARGETS = [
("templates/typora/udt.css", gen_typora, "templates/typora/udt.css.in"),
("templates/kvantum/theme.kvconfig", gen_kvantum, "templates/kvantum/theme.kvconfig.in"),
("templates/kvantum/theme.svg", gen_kvantum, "templates/kvantum/theme.svg.in"),
+ ("templates/kde/udt.colors", gen_kde, None),
("templates/sublime/udt.sublime-color-scheme", gen_sublime,
"templates/sublime/udt.sublime-color-scheme.in"),
("templates/sublime/udt.sublime-theme", gen_sublime_theme,