Sync GTK4/libadwaita/Qt/Tk gtkTtk themes, add Tcl/Tk, and fix lid-close input leak

- Extend geminux-sync-gtk-theme and geminux-apply-theme to synchronize GTK4/libadwaita (dconf + ADW_DISABLE_PORTAL=1), qt6ct (QT_QPA_PLATFORMTHEME=qt6ct:gtk3), Kvantum, and live classic/ttk Tk apps
- Preinstall dconf, gtk+2.0, tcl, tcl-lib, tcl-tls, tk, and custom zero-glycin geminux-gtkttk (GtkTtk 0.9 with XImage blitting, RESOURCE_MANAGER live reload, and *TkTheme: gtkTtk)
- Add kernel patch 0011 to open gemini-lid keyboard/touchscreen handles for synchronous raw Hall GPIO66 input filtering, inhibit SSD2092 touch while closed, and set 1 ms hall-switch / 10 ms keyboard-matrix debounce in DT
This commit is contained in:
Luxferre committed 2026-11-25 20:09:34 +02:00
1 parent 16fcaaaba6
commit 983d529ec3
87 files changed
+10943 -45

No files matched your search

+87 -11
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Verify all Geminux .xth themes, dunst synchronization, and GTK2/GTK3 synchronization."""
"""Verify all Geminux .xth themes, dunst synchronization, and GTK2/3/4/Qt synchronization."""
import glob
import os
@@ -22,7 +22,7 @@ REQUIRED_KEYS = (
"theme.accent", "theme.border", "theme.danger", "theme.dangerBg",
"dmenu.font", "dmenu.background", "dmenu.foreground", "dmenu.selbackground", "dmenu.selforeground",
"dwm.font", "dwm.normbgcolor", "dwm.normfgcolor", "dwm.selbgcolor", "dwm.selfgcolor",
"st.font", "st.background", "st.foreground", "st.cursorColor", "Xft.dpi",
"st.font", "st.background", "st.foreground", "st.cursorColor", "Xft.dpi", "*TkTheme",
)
HEX_RE = re.compile(r"^#[0-9a-fA-F]{6}$")
@@ -51,6 +51,7 @@ def main():
assert req in vals and vals[req], f"Missing {req} in {os.path.basename(th)}"
assert int(vals["Xft.dpi"]) >= 168, f"Expected Xft.dpi >= 168 in {os.path.basename(th)}"
assert int(vals["theme.baseFontSize"]) >= 28, f"Expected baseFontSize >= 28 in {os.path.basename(th)}"
assert vals["*TkTheme"] == "gtkTtk", f"Expected *TkTheme: gtkTtk in {os.path.basename(th)}"
assert "Fira Code" in vals["theme.fontFace"], f"Expected Fira Code in {os.path.basename(th)}"
assert "Fira Code" in vals["st.font"], f"Expected Fira Code in st.font of {os.path.basename(th)}"
assert "Fira Code" in vals["dmenu.font"], f"Expected Fira Code in dmenu.font of {os.path.basename(th)}"
@@ -74,8 +75,9 @@ def main():
gtk_env = {
k: v for k, v in os.environ.items()
if k not in (
"GEMINUX_GTK_THEMES_DIR", "GEMINUX_XDG_THEMES_DIR",
"GEMINUX_GTK2_RC", "GEMINUX_GTK3_DIR", "GEMINUX_XSETTINGSD_CONF",
"GEMINUX_RUNTIME_HOME", "GEMINUX_GTK_THEMES_DIR", "GEMINUX_XDG_THEMES_DIR",
"GEMINUX_GTK2_RC", "GEMINUX_GTK3_DIR", "GEMINUX_GTK4_DIR",
"GEMINUX_XSETTINGSD_CONF", "GEMINUX_QT6CT_DIR", "GEMINUX_KVANTUM_DIR",
)
}
gtk_env["HOME"] = th_home
@@ -87,7 +89,12 @@ def main():
theme_root = os.path.join(th_home, ".themes", gtk_name)
is_light = tname in LIGHT_THEMES
for cfg_rel in (".gtkrc-2.0", ".config/gtk-3.0/settings.ini", ".config/xsettingsd/xsettingsd.conf"):
for cfg_rel in (
".gtkrc-2.0",
".config/gtk-3.0/settings.ini",
".config/gtk-4.0/settings.ini",
".config/xsettingsd/xsettingsd.conf",
):
cfg_path = os.path.join(th_home, cfg_rel)
with open(cfg_path, encoding="utf-8") as cf:
cfg_txt = cf.read()
@@ -96,12 +103,58 @@ def main():
f"Hardcoded path leaked into {cfg_rel} for {tname}: {cfg_txt}"
)
with open(os.path.join(th_home, ".config/gtk-3.0/settings.ini"), encoding="utf-8") as sf:
ini_txt = sf.read()
exp_dark_bool = "false" if is_light else "true"
assert f"gtk-application-prefer-dark-theme={exp_dark_bool}" in ini_txt, (
f"Expected gtk-application-prefer-dark-theme={exp_dark_bool} for {tname}"
for ini_rel in (".config/gtk-3.0/settings.ini", ".config/gtk-4.0/settings.ini"):
with open(os.path.join(th_home, ini_rel), encoding="utf-8") as sf:
ini_txt = sf.read()
exp_dark_bool = "false" if is_light else "true"
assert f"gtk-application-prefer-dark-theme={exp_dark_bool}" in ini_txt, (
f"Expected gtk-application-prefer-dark-theme={exp_dark_bool} in {ini_rel} for {tname}"
)
with open(os.path.join(th_home, ".config/gtk-3.0/gtk.css"), encoding="utf-8") as css3u:
css3u_txt = css3u.read()
assert "@import" not in css3u_txt, f"Unexpected @import in user gtk-3.0/gtk.css for {tname}"
assert f"@define-color theme_bg_color {vals['theme.bgMain']};" in css3u_txt
with open(os.path.join(th_home, ".config/gtk-4.0/gtk.css"), encoding="utf-8") as adw_f:
adw_txt = adw_f.read()
assert "@import" not in adw_txt and "Default-" not in adw_txt, (
f"Unexpected Default theme @import in user gtk-4.0/gtk.css for {tname}"
)
assert adw_txt.count("{") == adw_txt.count("}"), f"Unbalanced braces in gtk-4.0/gtk.css for {tname}"
assert f"@define-color window_bg_color {vals['theme.bgMain']};" in adw_txt
assert f"--window-bg-color: {vals['theme.bgMain']};" in adw_txt
with open(os.path.join(th_home, ".config/qt6ct/qt6ct.conf"), encoding="utf-8") as qtf:
qt_txt = qtf.read()
assert "style=Fusion" in qt_txt
assert "custom_palette=true" in qt_txt
assert f"color_scheme_path={th_home}/.config/qt6ct/colors/{gtk_name}.conf" in qt_txt
assert f"Theme: {tname}" in qt_txt
assert vals["theme.fontFace"] in qt_txt
for qtc_rel in (f".config/qt6ct/colors/{gtk_name}.conf", ".config/qt6ct/colors/Geminux.conf"):
with open(os.path.join(th_home, qtc_rel), encoding="utf-8") as qtcf:
qtc_txt = qtcf.read()
qtc_map = {}
for line in qtc_txt.splitlines():
if "=" in line and not line.lstrip().startswith("#"):
k, v = line.split("=", 1)
qtc_map[k.strip()] = [c.strip() for c in v.split(",")]
for section in ("active_colors", "disabled_colors", "inactive_colors"):
cols = qtc_map.get(section, [])
assert len(cols) == 21, f"Expected 21 qt6ct palette roles in {section} for {tname}, got {len(cols)}"
for col in cols:
assert re.match(r"^#[0-9a-fA-F]{8}$", col), f"Invalid ARGB entry '{col}' in {section} for {tname}"
assert qtc_map["active_colors"][10] == f"#ff{vals['theme.bgMain'][1:].lower()}"
assert qtc_map["active_colors"][12] == f"#ff{vals['theme.selBg'][1:].lower()}"
with open(os.path.join(th_home, ".config/Kvantum/kvantum.kvconfig"), encoding="utf-8") as kvf:
assert "theme=Geminux" in kvf.read()
with open(os.path.join(th_home, ".config/Kvantum/Geminux/Geminux.kvconfig"), encoding="utf-8") as kvtf:
kvt_txt = kvtf.read()
assert f"window.color={vals['theme.bgMain']}" in kvt_txt
assert f"highlight.color={vals['theme.selBg']}" in kvt_txt
with open(os.path.join(th_home, ".config/xsettingsd/xsettingsd.conf"), encoding="utf-8") as xf:
xsd_txt = xf.read()
@@ -131,14 +184,37 @@ def main():
with open(os.path.join(theme_root, "gtk-3.0/gtk-dark.css"), encoding="utf-8") as css3df:
assert '@import url("gtk.css");' in css3df.read()
with open(os.path.join(theme_root, "gtk-4.0/gtk.css"), encoding="utf-8") as css4f:
css4_txt = css4f.read()
exp_gtk4_base = "Default-light.css" if is_light else "Default-dark.css"
assert f'@import url("resource:///org/gtk/libgtk/theme/Default/{exp_gtk4_base}");' in css4_txt, (
f"Wrong GTK4 base CSS in {tname}: expected {exp_gtk4_base}"
)
assert css4_txt.count("{") == css4_txt.count("}"), f"Unbalanced braces in gtk-4.0/gtk.css for {tname}"
for ck in ("theme.bgMain", "theme.fgMain", "theme.selBg", "theme.accent", "theme.dangerBg"):
assert vals[ck] in css4_txt, f"Missing {ck} in gtk-4.0/gtk.css for {tname}"
with open(os.path.join(theme_root, "gtk-4.0/gtk-dark.css"), encoding="utf-8") as css4df:
assert '@import url("gtk.css");' in css4df.read()
xdg_link = os.path.join(th_home, ".local/share/themes", gtk_name)
assert os.path.islink(xdg_link), f"Missing XDG symlink {xdg_link}"
assert os.readlink(xdg_link) == f"../../../.themes/{gtk_name}", (
f"Unexpected XDG symlink target for {tname}: {os.readlink(xdg_link)}"
)
assert os.path.isfile(os.path.join(xdg_link, "gtk-3.0/gtk.css"))
assert os.path.isfile(os.path.join(xdg_link, "gtk-4.0/gtk.css"))
print(f"[PASS] Verified {len(themes)} .xth themes, dunst synchronization, and GTK2/GTK3 theme generation")
skel_home = os.path.join(tmp, "skel")
os.makedirs(skel_home, exist_ok=True)
skel_env = dict(gtk_env, HOME=skel_home, GEMINUX_RUNTIME_HOME="/home/user", GEMINUX_XRESOURCES=themes[0])
subprocess.run([GTK_SYNC_SCRIPT, "--no-reload"], env=skel_env, check=True)
with open(os.path.join(skel_home, ".config/qt6ct/qt6ct.conf"), encoding="utf-8") as skf:
skel_qt = skf.read()
first_name = f"Geminux-{parse_xres(themes[0])['theme.name']}"
assert f"color_scheme_path=/home/user/.config/qt6ct/colors/{first_name}.conf" in skel_qt
print(f"[PASS] Verified {len(themes)} .xth themes, dunst synchronization, and GTK2/3/4/Qt/Tk theme generation")
return 0