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

+5 -3
View File
@@ -58,12 +58,12 @@ if command -v apk >/dev/null 2>&1 && \
# Clear any older @geminux world pins and installed hashes so rebuilt local
# packages with unchanged -r0 version strings always extract updated payloads.
if [ -f "$TARGET_ROOTFS/etc/apk/world" ]; then
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|gsocket|mpv|gdk-pixbuf|webarchy|config)(@|=|$)' \
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|gsocket|mpv|gdk-pixbuf|webarchy|gtkttk|config)(@|=|$)' \
"$TARGET_ROOTFS/etc/apk/world" > "$TARGET_ROOTFS/etc/apk/world.tmp" || true
mv "$TARGET_ROOTFS/etc/apk/world.tmp" "$TARGET_ROOTFS/etc/apk/world"
fi
apk --root "$TARGET_ROOTFS" --arch aarch64 del --no-scripts --purge=yes \
geminux-config geminux-webarchy geminux-mpv geminux-gsocket geminux-bantam geminux-ui geminux-dunst geminux-suckless \
geminux-config geminux-gtkttk geminux-webarchy geminux-mpv geminux-gsocket geminux-bantam geminux-ui geminux-dunst geminux-suckless \
geminux-xlibre geminux-kernel-modules 2>/dev/null || true
apk --root "$TARGET_ROOTFS" --arch aarch64 add --no-scripts --clean-protected=no \
@@ -76,6 +76,7 @@ if command -v apk >/dev/null 2>&1 && \
"geminux-bantam@geminux=${VER}-r0" \
"geminux-gsocket@geminux=1.4.43-r0" \
"geminux-webarchy@geminux=${VER}-r0" \
"geminux-gtkttk@geminux=0.9-r0" \
"geminux-config@geminux=${VER}-r0"
apk --root "$TARGET_ROOTFS" --arch aarch64 fix --no-scripts --reinstall geminux-gdk-pixbuf >/dev/null
else
@@ -83,7 +84,7 @@ else
if [ -d "$BASE_DIR/overlay/rootfs" ]; then
cp -af "$BASE_DIR/overlay/rootfs/." "$TARGET_ROOTFS/"
fi
for subdir in xlibre suckless dunst geminux bantam gsocket gdk-pixbuf webarchy; do
for subdir in xlibre suckless dunst geminux bantam gsocket gdk-pixbuf webarchy gtkttk; do
if [ -d "$BASE_DIR/prebuilt/$subdir" ]; then
cp -af "$BASE_DIR/prebuilt/$subdir/." "$TARGET_ROOTFS/"
fi
@@ -219,6 +220,7 @@ mkdir -p "$TARGET_ROOTFS/home/user/.cache" "$TARGET_ROOTFS/home/user/.config" \
"$TARGET_ROOTFS/home/user/Downloads"
if [ -x "$TARGET_ROOTFS/usr/bin/geminux-sync-gtk-theme" ]; then
HOME="$TARGET_ROOTFS/etc/skel" \
GEMINUX_RUNTIME_HOME="/home/user" \
GEMINUX_XRESOURCES="$TARGET_ROOTFS/etc/skel/.Xresources" \
"$TARGET_ROOTFS/usr/bin/geminux-sync-gtk-theme" --no-reload
fi
+1 -1
View File
@@ -56,7 +56,7 @@ apk add --no-cache python3 kmod openssl glib >/dev/null
echo "[3/8] Installing the Geminux aarch64 package set..."
PKGS="$(grep -v '^[[:space:]]*#' "$PKGS_FILE" | grep -v '^[[:space:]]*$' | tr '\n' ' ')"
if [ -f "$ROOTFS/etc/apk/world" ]; then
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|gsocket|mpv|gdk-pixbuf|webarchy|config)(@|=|$)' \
grep -v -E '^geminux-(kernel-modules|xlibre|suckless|dunst|ui|bantam|gsocket|mpv|gdk-pixbuf|webarchy|gtkttk|config)(@|=|$)' \
"$ROOTFS/etc/apk/world" > "$ROOTFS/etc/apk/world.tmp" || true
mv "$ROOTFS/etc/apk/world.tmp" "$ROOTFS/etc/apk/world"
fi
+95
View File
@@ -0,0 +1,95 @@
#!/bin/sh
# Cross-compile GtkTtk 0.9 dynamic GTK2 theme engine for Tk/Ttk/Tkinter (aarch64).
set -eu
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
mkdir -p "$BASE_DIR/prebuilt/gtkttk/usr/lib/gtkTtk0.9"
exec docker run --rm --network=host \
-e HOST_UID="$(id -u)" \
-e HOST_GID="$(id -g)" \
-v "$BASE_DIR:/geminux" \
alpine:3.24 sh -eu -c '
cat > /etc/apk/repositories <<EOF
https://mirror.nura.eco/postmarketos/v26.06
https://dl-cdn.alpinelinux.org/alpine/edge/main
https://dl-cdn.alpinelinux.org/alpine/edge/community
https://dl-cdn.alpinelinux.org/alpine/edge/testing
EOF
cp /geminux/keys/*.rsa.pub /etc/apk/keys/
cleanup_perms() {
chown -R "$HOST_UID:$HOST_GID" /geminux/prebuilt/gtkttk 2>/dev/null || true
}
trap cleanup_perms EXIT
echo "[1/3] Installing host aarch64 C++ cross-compile toolchain..."
apk add --no-cache \
build-base \
gcc-aarch64 \
g++-aarch64 \
binutils-aarch64 \
pkgconf \
make >/dev/null
echo "[2/3] Preparing pure Alpine Edge aarch64 sysroot for GtkTtk 0.9 (zero glycin)..."
SYSROOT="/tmp/aarch64-gtkttk-sysroot"
mkdir -p "$SYSROOT/etc/apk/keys"
cat > "$SYSROOT/etc/apk/repositories" <<EOF
https://dl-cdn.alpinelinux.org/alpine/edge/main
https://dl-cdn.alpinelinux.org/alpine/edge/community
https://dl-cdn.alpinelinux.org/alpine/edge/testing
EOF
cp /geminux/keys/alpine-devel@*.rsa.pub "$SYSROOT/etc/apk/keys/"
apk --root "$SYSROOT" --initdb --arch aarch64 add --no-scripts \
alpine-baselayout \
musl-dev \
libstdc++-dev \
tcl-dev \
tk-dev \
gtk+2.0-dev \
libx11-dev \
glib-dev \
cairo-dev \
pango-dev \
libpng-dev \
libjpeg-turbo-dev >/dev/null
# Overlay our pure-C gdk-pixbuf 2.42.12 and scrub any glycin-2 pkgconfig references.
rm -rf "$SYSROOT/usr/include/glycin-"* "$SYSROOT/usr/lib/libglycin"* "$SYSROOT/usr/lib/pkgconfig/glycin-"*.pc
if [ -d /geminux/prebuilt/gdk-pixbuf/usr ]; then
cp -af /geminux/prebuilt/gdk-pixbuf/. "$SYSROOT/"
ln -sfn libgdk_pixbuf-2.0.so.0 "$SYSROOT/usr/lib/libgdk_pixbuf-2.0.so"
fi
if [ -f "$SYSROOT/usr/lib/pkgconfig/gdk-pixbuf-2.0.pc" ]; then
sed -i -E "s/,?[[:space:]]*glycin-2[^,]*//g" "$SYSROOT/usr/lib/pkgconfig/gdk-pixbuf-2.0.pc"
fi
echo "[3/3] Cross-compiling and stripping libgtkTtk0.9.so for aarch64..."
export PKG_CONFIG_SYSROOT_DIR="$SYSROOT"
export PKG_CONFIG_LIBDIR="$SYSROOT/usr/lib/pkgconfig:$SYSROOT/usr/share/pkgconfig"
export PKG_CONFIG_PATH=""
WORK="/tmp/build-gtkttk"
OUT="/geminux/prebuilt/gtkttk/usr/lib/gtkTtk0.9"
rm -rf "$WORK" /geminux/prebuilt/gtkttk
mkdir -p "$WORK" "$OUT"
cp -a /geminux/src/gtkTtk/. "$WORK/"
GTK_CFLAGS="$(pkgconf --cflags gtk+-2.0 x11)"
GTK_LIBS="$(pkgconf --libs gtk+-2.0 x11)"
make -C "$WORK" clean || true
make -C "$WORK" -j"$(nproc)" \
CXX="aarch64-alpine-linux-musl-g++ --sysroot=$SYSROOT" \
EXTRA_CXXFLAGS="-march=armv8-a+crc+crypto -mtune=cortex-a53 -fno-plt $GTK_CFLAGS" \
EXTRA_LDFLAGS="$GTK_LIBS"
aarch64-alpine-linux-musl-strip --strip-unneeded "$WORK/libgtkTtk0.9.so"
install -m 0755 "$WORK/libgtkTtk0.9.so" "$OUT/libgtkTtk0.9.so"
install -m 0644 "$WORK/library/gtkTtk.tcl" "$OUT/gtkTtk.tcl"
install -m 0644 "$WORK/library/pkgIndex.tcl" "$OUT/pkgIndex.tcl"
ls -lh "$OUT"
aarch64-alpine-linux-musl-readelf -d "$OUT/libgtkTtk0.9.so" | grep NEEDED
'
+51 -3
View File
@@ -34,7 +34,7 @@ for bad_pkg in sway wayfire weston phosh cage xwayland grim slurp wofi \
exit 1
fi
done
for req_pkg in ffmpeg mpv gst-libav xsettingsd; do
for req_pkg in ffmpeg mpv gst-libav xsettingsd dconf gtk+2.0 tcl tcl-lib tcl-tls tk; do
if ! grep -Fxq "P:$req_pkg" "$ROOTFS_DIR/lib/apk/db/installed"; then
echo "FAIL: expected native package '$req_pkg' is not installed in rootfs" >&2
exit 1
@@ -130,7 +130,7 @@ docker run --rm --network=host \
for pkg in geminux-kernel-modules geminux-xlibre geminux-suckless \
geminux-dunst geminux-ui geminux-bantam geminux-gsocket \
geminux-gdk-pixbuf geminux-webarchy geminux-config; do
geminux-gdk-pixbuf geminux-webarchy geminux-gtkttk geminux-config; do
if ! grep -q "^${pkg}@geminux=" /rootfs/etc/apk/world; then
echo "FAIL: ${pkg} is not exact-version pinned to @geminux in world" >&2
exit 1
@@ -174,7 +174,8 @@ file \
"$BASE_DIR/prebuilt/gsocket/usr/local/bin/gsocket_uchroot_dso.so.0" \
"$BASE_DIR/prebuilt/gdk-pixbuf/usr/bin/gdk-pixbuf-"* \
"$BASE_DIR/prebuilt/gdk-pixbuf/usr/lib/libgdk_pixbuf-2.0.so.0."* \
"$BASE_DIR/prebuilt/webarchy/usr/bin/webarchy" | \
"$BASE_DIR/prebuilt/webarchy/usr/bin/webarchy" \
"$BASE_DIR/prebuilt/gtkttk/usr/lib/gtkTtk0.9/libgtkTtk0.9.so" | \
awk '!/ARM aarch64/ { print "FAIL: not aarch64: " $0; bad=1 } END { exit bad }'
echo "OK (all aarch64 ELFs verified)"
@@ -366,12 +367,35 @@ for req_rel in ("etc/pam.d/autologin", "etc/init.d/geminux-hwinit",
"root/.apexrc",
"usr/bin/xsetroot",
"usr/bin/xsettingsd",
"usr/bin/dconf",
"usr/libexec/dconf-service",
"usr/bin/tclsh",
"usr/bin/wish",
"usr/lib/gtkTtk0.9/libgtkTtk0.9.so",
"usr/lib/gtkTtk0.9/gtkTtk.tcl",
"usr/lib/gtkTtk0.9/pkgIndex.tcl",
"usr/bin/geminux-sync-gtk-theme",
"etc/skel/.gtkrc-2.0",
"etc/skel/.config/gtk-3.0/settings.ini",
"etc/skel/.config/gtk-3.0/gtk.css",
"etc/skel/.config/gtk-4.0/settings.ini",
"etc/skel/.config/gtk-4.0/gtk.css",
"etc/skel/.config/qt6ct/qt6ct.conf",
"etc/skel/.config/qt6ct/colors/Geminux.conf",
"etc/skel/.config/qt6ct/colors/Geminux-GeminuxHelio.conf",
"etc/skel/.config/Kvantum/kvantum.kvconfig",
"etc/skel/.config/Kvantum/Geminux/Geminux.kvconfig",
"etc/skel/.config/xsettingsd/xsettingsd.conf",
"home/user/.gtkrc-2.0",
"home/user/.config/gtk-3.0/settings.ini",
"home/user/.config/gtk-3.0/gtk.css",
"home/user/.config/gtk-4.0/settings.ini",
"home/user/.config/gtk-4.0/gtk.css",
"home/user/.config/qt6ct/qt6ct.conf",
"home/user/.config/qt6ct/colors/Geminux.conf",
"home/user/.config/qt6ct/colors/Geminux-GeminuxHelio.conf",
"home/user/.config/Kvantum/kvantum.kvconfig",
"home/user/.config/Kvantum/Geminux/Geminux.kvconfig",
"home/user/.config/xsettingsd/xsettingsd.conf",
"etc/NetworkManager/dispatcher.d/30-geminux-chrony",
"etc/polkit-1/rules.d/10-geminux.rules"):
@@ -398,6 +422,10 @@ for rel, needle in (
("etc/NetworkManager/conf.d/20-geminux-wifi.conf", "wifi.scan-rand-mac-address = no"),
("etc/NetworkManager/conf.d/20-geminux-wifi.conf", "wifi-sec.pmf = 1"),
("etc/shells", "/bin/bash"),
("etc/profile.d/10-geminux-env.sh", "QT_QPA_PLATFORMTHEME=qt6ct:gtk3"),
("etc/profile.d/10-geminux-env.sh", "ADW_DISABLE_PORTAL=1"),
("etc/skel/.Xresources", "*TkTheme: gtkTtk"),
("etc/skel/.config/qt6ct/qt6ct.conf", "color_scheme_path=/home/user/.config/qt6ct/colors/Geminux-GeminuxHelio.conf"),
("usr/bin/geminux-launcher", "Webarchy Browser"),
("usr/bin/geminux-launcher", "Bantam AI agent"),
):
@@ -517,6 +545,18 @@ docker run --rm -i -v "$IMAGES_DIR:/images:ro" -v "$BASE_DIR/prebuilt/kernel/boo
/ldo-va18 \{/ { in_va18=1; next }
in_va18 && /\};/ { in_va18=0 }
in_va18 && /regulator-always-on;/ { found_va18=1 }
/^\tgpio-keys \{/ { in_hall=1; depth_h=1; next }
in_hall {
if ($0 ~ /\{/) depth_h++
if ($0 ~ /\}/) { depth_h--; if (depth_h == 0) in_hall=0 }
if (in_hall && $0 ~ /debounce-interval = <(0x0*1|1)>;/) hall_deb=1
}
/^\tkeyboard-matrix \{/ { in_kbd=1; depth_k=1; next }
in_kbd {
if ($0 ~ /\{/) depth_k++
if ($0 ~ /\}/) { depth_k--; if (depth_k == 0) in_kbd=0 }
if (in_kbd && depth_k == 1 && $0 ~ /debounce-delay-ms = <(0x0*a|10)>;/) kbd_deb=1
}
END {
if (!found_ok || found_dis) {
print "FAIL: DTB i2c@11007000 (&i2c0) must have status = \"okay\"" > "/dev/stderr"
@@ -530,6 +570,14 @@ docker run --rm -i -v "$IMAGES_DIR:/images:ro" -v "$BASE_DIR/prebuilt/kernel/boo
print "FAIL: DTB ldo-va18 must have regulator-always-on" > "/dev/stderr"
exit 1
}
if (!hall_deb) {
print "FAIL: DTB hall-switch must have debounce-interval = <1>" > "/dev/stderr"
exit 1
}
if (!kbd_deb) {
print "FAIL: DTB keyboard-matrix must have debounce-delay-ms = <10>" > "/dev/stderr"
exit 1
}
if (!pwm_ok || pwm_dis || pwm_pd) {
print "FAIL: DTB pwm@1100f000 (&disp_pwm) must be okay without power-domains" > "/dev/stderr"
exit 1
+13 -1
View File
@@ -282,7 +282,18 @@ make_pkg(
] + collect_needed_so(wstage),
)
# 10. geminux-config
# 10. geminux-gtkttk
tkstage = os.path.join(work_dir, "geminux-gtkttk")
copy_tree_dedup("/geminux/prebuilt/gtkttk", tkstage)
make_pkg(
"geminux-gtkttk", "0.9-r0",
"GtkTtk 0.9 dynamic GTK2 theme engine for Tk/Ttk/Tkinter with zero-poll X11 reload",
tkstage,
provides=["gtkTtk=0.9-r0"],
depends=["tcl", "tk", "gtk+2.0", "geminux-gdk-pixbuf=2.42.12-r0"] + collect_needed_so(tkstage),
)
# 11. geminux-config
cstage = os.path.join(work_dir, "geminux-config")
copy_tree_dedup("/geminux/overlay/rootfs", cstage, dedup=True)
for rel in ("etc/os-release", "usr/lib/os-release", "etc/issue", "etc/motd"):
@@ -307,6 +318,7 @@ make_pkg(
f"geminux-gsocket=1.4.43-r0",
f"geminux-gdk-pixbuf=2.42.12-r0",
f"geminux-webarchy={pkg_ver}",
f"geminux-gtkttk=0.9-r0",
],
replaces=[
"alpine-baselayout",
+6
View File
@@ -24,6 +24,7 @@ dav1d
dbus
dbus-libs
dbus-openrc
dconf
dnsmasq
doas
dosfstools
@@ -53,6 +54,7 @@ gst-libav
gst-plugins-base
gst-plugins-good
gstreamer
gtk+2.0
harfbuzz
hicolor-icon-theme
htop
@@ -159,9 +161,13 @@ spandsp3
sqlite-libs
strongswan
sudo
tcl
tcl-lib
tcl-tls
tinydm
tinydm-openrc
tinydm-x11
tk
tzdata
uchardet-libs
usbutils
+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