feat(helium): switch to the GTK theme with KWin title buttons

Helium now takes its colors from Breeze GTK instead of a generated
theme extension, which reset the GTK theme on every launch.

- Import window_decorations.css from gtk.css so Helium, which doesn't
  load kde-gtk-config's GTK module, draws the KWin title buttons
  instead of Breeze GTK's round ones.
- Add chromium.css to give the compact layout's address bar and
  button segment the title bar color, so the tab strip is one color.
- Disable WaylandWpColorManagerV1 so KWin doesn't lift Helium's dark
  grays (40 -> 44) and the strip matches KDE title bars.
- Drop the Helium theme from build.py and the helium package.
This commit is contained in:
tri committed 2026-11-03 22:18:52 +07:00
1 parent b14133bbec
commit 09c1e312cb
9 files changed
+74 -184

No files matched your search

+3 -53
View File
@@ -4,7 +4,6 @@
.local/share/color-schemes/DarwinBreezeDark.colors is the only place colors
are defined. This script derives from it:
../helium/.local/share/helium-themes/darwinbreeze/manifest.json
t3/darwin-breeze.json (published to T3 Code by apply.sh)
telegram/DarwinBreezeDark.tdesktop-theme (not committed; imported into Telegram by hand)
vscode/ (packed into vscode/darwin-breeze.vsix, installed by apply.sh)
@@ -24,7 +23,6 @@ from pathlib import Path
HERE = Path(__file__).resolve().parent
PKG = HERE
SCHEME = PKG / ".local/share/color-schemes/DarwinBreezeDark.colors"
HELIUM = PKG.parent / "helium/.local/share/helium-themes/darwinbreeze"
T3 = HERE / "t3/darwin-breeze.json"
# Telegram Desktop's built-in night theme, used as the base for every key the
# scheme has no role for: the colors file from telegramdesktop/tdesktop at
@@ -54,10 +52,6 @@ CYAN = (100, 210, 255)
# Apple systemYellow; search highlights in T3 Code.
YELLOW = (255, 255, 0)
# Breeze draws inactive tabs this far from the window color towards the text
# color (measured in Dolphin: 40 -> 62 with text 222).
INACTIVE_TAB_MIX = 0.12
def load() -> ColorFn:
cp = configparser.ConfigParser(interpolation=None, strict=False)
@@ -84,7 +78,8 @@ def kwin_compensate(c: Sequence[int]) -> list[int]:
Chromium tags its surfaces as sRGB, KWin shows them with a gamma 2.2
curve, so dark grays come out lighter (40 -> 44). Encoding the target
with the inverse makes Helium land on the same values as native apps.
with the inverse makes Chromium apps land on the same values as native
apps.
"""
def ch(v: int) -> int:
@@ -95,40 +90,6 @@ def kwin_compensate(c: Sequence[int]) -> list[int]:
return [ch(v) for v in c]
def helium(color: ColorFn) -> dict[str, list[int]]:
bar = color("Header", "BackgroundNormal")
text = color("Window", "ForegroundNormal")
view = color("View", "BackgroundNormal")
view_text = color("View", "ForegroundNormal")
inactive_tab = mix(bar, text, INACTIVE_TAB_MIX)
# In Helium's compact layout the active tab and the toolbar segments on
# either side share the toolbar color, so toolbar and frame must match
# for the strip to read as one bar. Inactive tabs get the lighter Breeze
# tab color, the way Dolphin draws them.
colors = {
"frame": bar,
"frame_inactive": bar,
"frame_incognito": bar,
"frame_incognito_inactive": bar,
"toolbar": bar,
"background_tab": inactive_tab,
"background_tab_inactive": inactive_tab,
"tab_text": text,
"tab_background_text": text,
"tab_background_text_inactive": color("Window", "ForegroundInactive"),
"toolbar_text": text,
"toolbar_button_icon": text,
"bookmark_text": text,
"omnibox_background": view,
"omnibox_text": view_text,
"ntp_background": view,
"ntp_text": view_text,
"ntp_link": color("View", "ForegroundLink"),
}
return {k: kwin_compensate(v) for k, v in colors.items()}
def ansi(color: ColorFn) -> list[Color]:
"""The 16 colors for the VS Code terminal."""
bg = color("View", "BackgroundNormal")
@@ -530,7 +491,7 @@ def vscode(color: ColorFn) -> dict[str, str]:
colors = {k: pins.get(k) or recolor(c) for k, c in base.items()}
colors.update(pins)
# Electron is Chromium, so it needs the same KWin compensation as Helium.
# Electron is Chromium, so it needs the KWin compensation.
return {k: hexc(kwin_compensate(c[:3]) + list(c[3:])) for k, c in sorted(colors.items())}
@@ -638,17 +599,6 @@ def write(path: Path, data: str | bytes) -> bool:
def main() -> None:
color = load()
manifest = {
"manifest_version": 3,
"name": "Darwin Breeze",
"version": "1.0",
"description": f"Generated by kde/theme/build.py from {SCHEME.name}",
"theme": {"colors": helium(color)},
}
if write(HELIUM / "manifest.json", json.dumps(manifest, indent=2) + "\n"):
# Helium would keep showing the old colors from its cache.
(HELIUM / "Cached Theme.pak").unlink(missing_ok=True)
theme = {"version": 1, "name": "Darwin Breeze", "appearance": "dark", "colors": t3(color)}
write(T3, json.dumps(theme, indent=2) + "\n")