Backport WM/dmenu xerror & UTF-8 fixes, add wallpaper manager, and set Anodized default

- wm,dmenu: backport ANODE a92e196 fixes for xerror recursion guards, non-fatal RENDER error suppression, bounded getservertime() polling, pointer ungrab/AsyncBoth/GrabModeAsync grab safety, FC_COLOR=FcFalse substitution, and UTF-8 sanitization + Pango ellipsization in drw.c
- wallpaper: port native X11 + Cairo wallpaper engine (geminux-wallpaper.h, geminux-wallpaper-x11.h) with pure-C gdk-pixbuf/PNG/JPEG/WebP/magick decoding, Wallpaper tab + CLI in geminux-themes, geminux-apply-wallpaper helper, and session/theme/HDMI/launcher hooks
- theme: set Anodized as default theme in /etc/skel/.Xresources and compiled-in/script fallbacks across libgemui, dwm, dmenu, st, webarchy, geminux-sync-gtk-theme, and geminux-sync-dunst-theme
- verify: extend check-rebuild.sh and test-theme-dunst-sync.py, prune stale skel theme artifacts in apply-geminux-overlay.sh, and rebuild prebuilt binaries
This commit is contained in:
Luxferre committed 2026-11-27 17:13:35 +02:00
1 parent 6fcc263256
commit 09c1e2ad36
32 files changed
+2852 -304

No files matched your search

+6
View File
@@ -219,6 +219,12 @@ mkdir -p "$TARGET_ROOTFS/home/user/.cache" "$TARGET_ROOTFS/home/user/.config" \
"$TARGET_ROOTFS/home/user/Pictures" "$TARGET_ROOTFS/home/user/Videos" \
"$TARGET_ROOTFS/home/user/Downloads"
if [ -x "$TARGET_ROOTFS/usr/bin/geminux-sync-gtk-theme" ]; then
rm -rf "$TARGET_ROOTFS/etc/skel/.themes"/Geminux-* \
"$TARGET_ROOTFS/etc/skel/.local/share/themes"/Geminux-* \
"$TARGET_ROOTFS/etc/skel/.config/qt6ct/colors"/Geminux-*.conf \
"$TARGET_ROOTFS/home/user/.themes"/Geminux-* \
"$TARGET_ROOTFS/home/user/.local/share/themes"/Geminux-* \
"$TARGET_ROOTFS/home/user/.config/qt6ct/colors"/Geminux-*.conf
HOME="$TARGET_ROOTFS/etc/skel" \
GEMINUX_RUNTIME_HOME="/home/user" \
GEMINUX_XRESOURCES="$TARGET_ROOTFS/etc/skel/.Xresources" \
+2
View File
@@ -54,6 +54,7 @@ EOF
libx11-dev \
libxft-dev \
libxext-dev \
libxinerama-dev \
libxrandr-dev \
libxi-dev \
libxtst-dev \
@@ -63,6 +64,7 @@ EOF
glib-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
fontconfig-dev \
freetype-dev \
expat-dev \
+21 -4
View File
@@ -382,7 +382,7 @@ for req_rel in ("etc/pam.d/autologin", "etc/init.d/geminux-hwinit",
"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/qt6ct/colors/Geminux-Anodized.conf",
"etc/skel/.config/Kvantum/kvantum.kvconfig",
"etc/skel/.config/Kvantum/Geminux/Geminux.kvconfig",
"etc/skel/.config/xsettingsd/xsettingsd.conf",
@@ -393,12 +393,13 @@ for req_rel in ("etc/pam.d/autologin", "etc/init.d/geminux-hwinit",
"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/qt6ct/colors/Geminux-Anodized.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"):
"etc/polkit-1/rules.d/10-geminux.rules",
"usr/bin/geminux-apply-wallpaper"):
if not os.path.lexists(os.path.join(rootfs, req_rel)):
raise SystemExit(f"FAIL: missing required path {os.path.join(rootfs, req_rel)}")
if os.path.lexists(os.path.join(rootfs, "usr/lib/geminux-mpv")):
@@ -424,10 +425,12 @@ for rel, needle in (
("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", "theme.name: Anodized"),
("etc/skel/.Xresources", "*TkTheme: gtkTtk"),
("etc/skel/.config/qt6ct/qt6ct.conf", "color_scheme_path=/home/user/.config/qt6ct/colors/Geminux-GeminuxHelio.conf"),
("etc/skel/.config/qt6ct/qt6ct.conf", "color_scheme_path=/home/user/.config/qt6ct/colors/Geminux-Anodized.conf"),
("usr/bin/geminux-launcher", "Webarchy Browser"),
("usr/bin/geminux-launcher", "Bantam AI agent"),
("usr/bin/geminux-launcher", "Wallpaper"),
):
p = os.path.join(rootfs, rel)
with open(p, "r", encoding="utf-8") as f:
@@ -445,6 +448,20 @@ with open(os.path.join(repo_dir, "src/dwm/dwm.c"), "r", encoding="utf-8") as f:
dwm_src = f.read()
if "PropertyChangeMask |\n FocusChangeMask;" not in dwm_src or "NotifyWhileGrabbed" not in dwm_src:
raise SystemExit("FAIL: src/dwm/dwm.c missing root FocusChangeMask or NotifyWhileGrabbed guard")
for sym in ("render_opcode", "in_xerror", "XAllowEvents(dpy, AsyncBoth, CurrentTime)", "XUngrabPointer(dpy, CurrentTime)"):
if sym not in dwm_src:
raise SystemExit(f"FAIL: src/dwm/dwm.c missing {sym}")
with open(os.path.join(repo_dir, "src/dmenu/dmenu.c"), "r", encoding="utf-8") as f:
dmenu_src = f.read()
for sym in ("dmenu_xerror", "dmenu_render_opcode"):
if sym not in dmenu_src:
raise SystemExit(f"FAIL: src/dmenu/dmenu.c missing {sym}")
for drw_rel in ("src/dwm/drw.c", "src/dmenu/drw.c"):
with open(os.path.join(repo_dir, drw_rel), "r", encoding="utf-8") as f:
drw_src = f.read()
for sym in ("drw_fc_substitute", "drw_sanitize_utf8", "PANGO_ELLIPSIZE_END"):
if sym not in drw_src:
raise SystemExit(f"FAIL: {drw_rel} missing {sym}")
with open(os.path.join(repo_dir, "src/st/x.c"), "r", encoding="utf-8") as f:
stx_src = f.read()
if 'ttywrite("\\033[I", 3, 0);\n\t\tredraw();' not in stx_src or 'ttywrite("\\033[O", 3, 0);\n\t\tredraw();' not in stx_src:
+83 -1
View File
@@ -44,6 +44,8 @@ def main():
themes = sorted(glob.glob(os.path.join(THEMES_DIR, "*.xth")))
assert len(themes) >= 22, f"Expected >= 22 themes, found {len(themes)}"
assert any(os.path.basename(th) == "Anodized.xth" for th in themes), "Missing Anodized.xth"
def_xres = parse_xres(os.path.join(BASE_DIR, "overlay", "rootfs", "etc", "skel", ".Xresources"))
assert def_xres.get("theme.name") == "Anodized", f"Expected default theme Anodized, got {def_xres.get('theme.name')}"
with tempfile.TemporaryDirectory(prefix="geminux-dunst-test-") as tmp:
for idx, th in enumerate(themes):
@@ -280,7 +282,87 @@ def main():
assert os.path.isfile(xth_dunstrc)
assert os.path.isfile(os.path.join(xth_home, ".themes/Geminux-Custom_Test/gtk-3.0/gtk.css"))
print(f"[PASS] Verified {len(themes)} .xth themes, geminux-xth.h, dunst synchronization, and GTK2/3/4/Qt/Tk theme generation")
wp_hdr = os.path.join(BASE_DIR, "src", "geminux-apps", "geminux-wallpaper.h")
wp_c = os.path.join(tmp, "test_wp.c")
wp_bin = os.path.join(tmp, "test_wp")
wp_dir = os.path.join(tmp, "wp_cfg_dir")
wp_conf = os.path.join(wp_dir, "wallpaper.conf")
with open(wp_c, "w", encoding="utf-8") as cf:
cf.write(
'#include <assert.h>\n'
'#include <math.h>\n'
'#include <stdio.h>\n'
'#include <string.h>\n'
f'#include "{wp_hdr}"\n'
'int main(void) {\n'
' geminux_wp_mode_t m = GEMINUX_WP_FILL;\n'
' assert(strcmp(geminux_wp_mode_name(GEMINUX_WP_FILL), "fill") == 0);\n'
' assert(strcmp(geminux_wp_mode_label(GEMINUX_WP_SPAN), "Span") == 0);\n'
' assert(geminux_wp_mode_parse("FILL", &m) && m == GEMINUX_WP_FILL);\n'
' assert(geminux_wp_mode_parse("Fit", &m) && m == GEMINUX_WP_FIT);\n'
' assert(geminux_wp_mode_parse("center", &m) && m == GEMINUX_WP_CENTER);\n'
' assert(geminux_wp_mode_parse("tile", &m) && m == GEMINUX_WP_TILE);\n'
' assert(geminux_wp_mode_parse("stretch", &m) && m == GEMINUX_WP_STRETCH);\n'
' assert(geminux_wp_mode_parse("span", &m) && m == GEMINUX_WP_SPAN);\n'
' assert(geminux_wp_mode_parse("zoom", &m) && m == GEMINUX_WP_FILL);\n'
' assert(!geminux_wp_mode_parse("bogus", &m));\n'
' assert(geminux_wp_is_image_name("photo.JPG"));\n'
' assert(geminux_wp_is_image_name("/home/user/Pictures/desk.webp"));\n'
' assert(geminux_wp_is_image_name("vector.svg"));\n'
' assert(!geminux_wp_is_image_name("notes.txt"));\n'
' assert(!geminux_wp_is_image_name(".png"));\n'
' assert(!geminux_wp_is_image_name("no_extension"));\n'
' int r = -1, g = -1, b = -1;\n'
' assert(geminux_wp_parse_hex("#1a2b3c", &r, &g, &b) && r == 0x1a && g == 0x2b && b == 0x3c);\n'
' assert(geminux_wp_parse_hex("AABBCC", &r, &g, &b) && r == 0xaa && g == 0xbb && b == 0xcc);\n'
' assert(!geminux_wp_parse_hex("#123", &r, &g, &b));\n'
' assert(!geminux_wp_parse_hex("#gggggg", &r, &g, &b));\n'
' double px = 0, py = 0, pw = 0, ph = 0;\n'
' geminux_wp_calc_placement(1920, 1080, 1600, 1200, GEMINUX_WP_FILL, &px, &py, &pw, &ph);\n'
' assert(fabs(ph - 1200.0) < 0.01 && pw > 1600.0 && px < 0.0 && fabs(py) < 0.01);\n'
' geminux_wp_calc_placement(1920, 1080, 1600, 1200, GEMINUX_WP_FIT, &px, &py, &pw, &ph);\n'
' assert(fabs(pw - 1600.0) < 0.01 && fabs(ph - 900.0) < 0.01 && fabs(px) < 0.01 && fabs(py - 150.0) < 0.01);\n'
' geminux_wp_calc_placement(800, 600, 1600, 1200, GEMINUX_WP_CENTER, &px, &py, &pw, &ph);\n'
' assert(fabs(pw - 800.0) < 0.01 && fabs(ph - 600.0) < 0.01 && fabs(px - 400.0) < 0.01 && fabs(py - 300.0) < 0.01);\n'
' geminux_wp_calc_placement(800, 600, 1600, 1200, GEMINUX_WP_STRETCH, &px, &py, &pw, &ph);\n'
' assert(fabs(px) < 0.01 && fabs(py) < 0.01 && fabs(pw - 1600.0) < 0.01 && fabs(ph - 1200.0) < 0.01);\n'
' geminux_wp_cfg_t cfg, loaded;\n'
f' assert(!geminux_wp_cfg_load("{wp_conf}", &loaded));\n'
' geminux_wp_cfg_init(&cfg);\n'
' cfg.type = GEMINUX_WP_IMAGE;\n'
' cfg.mode = GEMINUX_WP_FIT;\n'
' snprintf(cfg.path, sizeof(cfg.path), "/home/user/Pictures/desk.png");\n'
' snprintf(cfg.color, sizeof(cfg.color), "#112233");\n'
' cfg.use_theme_bg = false;\n'
f' assert(geminux_wp_cfg_save("{wp_conf}", &cfg));\n'
f' assert(geminux_wp_cfg_load("{wp_conf}", &loaded));\n'
' assert(loaded.type == GEMINUX_WP_IMAGE && loaded.mode == GEMINUX_WP_FIT);\n'
' assert(strcmp(loaded.path, "/home/user/Pictures/desk.png") == 0);\n'
' assert(strcmp(loaded.color, "#112233") == 0 && !loaded.use_theme_bg);\n'
' cfg.type = GEMINUX_WP_SOLID;\n'
' cfg.use_theme_bg = true;\n'
f' assert(geminux_wp_cfg_save("{wp_conf}", &cfg));\n'
f' assert(geminux_wp_cfg_load("{wp_conf}", &loaded));\n'
' assert(loaded.type == GEMINUX_WP_SOLID && loaded.use_theme_bg);\n'
' return 0;\n'
'}\n'
)
subprocess.run(["cc", "-std=c11", "-Wall", "-Wextra", "-Werror", wp_c, "-o", wp_bin, "-lm"], check=True)
subprocess.run([wp_bin], check=True)
wp_script = os.path.join(BASE_DIR, "overlay", "rootfs", "usr", "bin", "geminux-apply-wallpaper")
subprocess.run(["sh", "-n", wp_script], check=True)
wp_help = subprocess.run([wp_script, "--help"], capture_output=True, text=True, check=True)
assert "--restore" in wp_help.stdout and "--apply-wallpaper" not in wp_help.stdout
for srel, needle in (
("overlay/rootfs/usr/bin/geminux-session", "geminux-apply-wallpaper --restore"),
("overlay/rootfs/usr/bin/geminux-apply-theme", "geminux-apply-wallpaper --restore"),
("overlay/rootfs/usr/bin/geminux-launcher", "geminux-themes --wallpaper"),
):
with open(os.path.join(BASE_DIR, srel), encoding="utf-8") as sf:
assert needle in sf.read(), f"Missing '{needle}' in {srel}"
print(f"[PASS] Verified {len(themes)} .xth themes, geminux-xth.h, wallpaper helpers, dunst synchronization, and GTK2/3/4/Qt/Tk theme generation")
return 0