wallpaper: bundle stock wallpapers and default to geminux-dark.png
This commit is contained in:
1 parent
8a7d466655
commit
5472d4273a
9 files changed
+94
-19
No files matched your search
@@ -84,6 +84,12 @@ else
|
||||
if [ -d "$BASE_DIR/overlay/rootfs" ]; then
|
||||
cp -af "$BASE_DIR/overlay/rootfs/." "$TARGET_ROOTFS/"
|
||||
fi
|
||||
if [ -d "$BASE_DIR/artwork/wallpapers" ]; then
|
||||
mkdir -p "$TARGET_ROOTFS/usr/share/geminux/wallpapers"
|
||||
cp -af "$BASE_DIR/artwork/wallpapers/." "$TARGET_ROOTFS/usr/share/geminux/wallpapers/"
|
||||
chmod 0755 "$TARGET_ROOTFS/usr/share/geminux/wallpapers"
|
||||
chmod 0644 "$TARGET_ROOTFS/usr/share/geminux/wallpapers/"* 2>/dev/null || true
|
||||
fi
|
||||
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/"
|
||||
|
||||
@@ -399,7 +399,11 @@ for req_rel in ("etc/pam.d/autologin", "etc/init.d/geminux-hwinit",
|
||||
"home/user/.config/xsettingsd/xsettingsd.conf",
|
||||
"etc/NetworkManager/dispatcher.d/30-geminux-chrony",
|
||||
"etc/polkit-1/rules.d/10-geminux.rules",
|
||||
"usr/bin/geminux-apply-wallpaper"):
|
||||
"usr/bin/geminux-apply-wallpaper",
|
||||
"usr/share/geminux/wallpapers/geminux-dark.png",
|
||||
"usr/share/geminux/wallpapers/geminux-light.png",
|
||||
"etc/skel/.config/geminux/wallpaper.conf",
|
||||
"home/user/.config/geminux/wallpaper.conf"):
|
||||
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")):
|
||||
@@ -431,6 +435,8 @@ for rel, needle in (
|
||||
("usr/bin/geminux-launcher", "Webarchy Browser"),
|
||||
("usr/bin/geminux-launcher", "Bantam AI agent"),
|
||||
("usr/bin/geminux-launcher", "Wallpaper"),
|
||||
("etc/skel/.config/geminux/wallpaper.conf", "PATH=/usr/share/geminux/wallpapers/geminux-dark.png"),
|
||||
("home/user/.config/geminux/wallpaper.conf", "PATH=/usr/share/geminux/wallpapers/geminux-dark.png"),
|
||||
):
|
||||
p = os.path.join(rootfs, rel)
|
||||
with open(p, "r", encoding="utf-8") as f:
|
||||
@@ -519,6 +525,15 @@ docker run --rm -i -v "$IMAGES_DIR:/images:ro" -v "$BASE_DIR/prebuilt/kernel/boo
|
||||
debugfs -R "stat /home/user" /images/geminux-rootfs.img | grep -qE "User:[[:space:]]*10000\b" || {
|
||||
echo "FAIL: geminux-rootfs.img /home/user is not UID 10000" >&2; exit 1;
|
||||
}
|
||||
debugfs -R "stat /usr/share/geminux/wallpapers/geminux-dark.png" /images/geminux-rootfs.img | grep -qE "Mode:[[:space:]]*0?(10)?0644\b" || {
|
||||
echo "FAIL: geminux-rootfs.img /usr/share/geminux/wallpapers/geminux-dark.png missing or not 0644" >&2; exit 1;
|
||||
}
|
||||
debugfs -R "stat /usr/share/geminux/wallpapers/geminux-light.png" /images/geminux-rootfs.img | grep -qE "Mode:[[:space:]]*0?(10)?0644\b" || {
|
||||
echo "FAIL: geminux-rootfs.img /usr/share/geminux/wallpapers/geminux-light.png missing or not 0644" >&2; exit 1;
|
||||
}
|
||||
debugfs -R "stat /home/user/.config/geminux/wallpaper.conf" /images/geminux-rootfs.img | grep -qE "User:[[:space:]]*10000\b" || {
|
||||
echo "FAIL: geminux-rootfs.img /home/user/.config/geminux/wallpaper.conf missing or not UID 10000" >&2; exit 1;
|
||||
}
|
||||
DTS_OUT="$(dtc -I dtb -O dts /kboot/mt6797-gemini-pda-geminux.dtb 2>/dev/null)"
|
||||
printf "%s\n" "$DTS_OUT" | grep -qE "^\tmemory \{$" || { echo "FAIL: DTB missing /memory node" >&2; exit 1; }
|
||||
if printf "%s\n" "$DTS_OUT" | grep -qE "^\tmemory@40000000 \{$"; then
|
||||
|
||||
@@ -296,6 +296,17 @@ make_pkg(
|
||||
# 11. geminux-config
|
||||
cstage = os.path.join(work_dir, "geminux-config")
|
||||
copy_tree_dedup("/geminux/overlay/rootfs", cstage, dedup=True)
|
||||
wp_src = "/geminux/artwork/wallpapers"
|
||||
if os.path.isdir(wp_src):
|
||||
wp_dst = os.path.join(cstage, "usr", "share", "geminux", "wallpapers")
|
||||
os.makedirs(wp_dst, exist_ok=True)
|
||||
os.chmod(wp_dst, 0o755)
|
||||
for fn in sorted(os.listdir(wp_src)):
|
||||
sp = os.path.join(wp_src, fn)
|
||||
if os.path.isfile(sp) and not os.path.islink(sp):
|
||||
dp = os.path.join(wp_dst, fn)
|
||||
shutil.copy2(sp, dp)
|
||||
os.chmod(dp, 0o644)
|
||||
for rel in ("etc/os-release", "usr/lib/os-release", "etc/issue", "etc/motd"):
|
||||
p = os.path.join(cstage, rel)
|
||||
if os.path.isfile(p):
|
||||
|
||||
@@ -283,6 +283,14 @@ def main():
|
||||
assert os.path.isfile(os.path.join(xth_home, ".themes/Geminux-Custom_Test/gtk-3.0/gtk.css"))
|
||||
|
||||
wp_hdr = os.path.join(BASE_DIR, "src", "geminux-apps", "geminux-wallpaper.h")
|
||||
skel_wp_conf = os.path.join(BASE_DIR, "overlay", "rootfs", "etc", "skel", ".config", "geminux", "wallpaper.conf")
|
||||
assert os.path.isfile(skel_wp_conf), f"Missing default skel wallpaper config: {skel_wp_conf}"
|
||||
for wp_png in ("geminux-dark.png", "geminux-light.png"):
|
||||
wp_png_path = os.path.join(BASE_DIR, "artwork", "wallpapers", wp_png)
|
||||
assert os.path.isfile(wp_png_path), f"Missing bundled wallpaper: {wp_png_path}"
|
||||
with open(wp_png_path, "rb") as pf:
|
||||
assert pf.read(8) == b"\x89PNG\r\n\x1a\n", f"Invalid PNG header in {wp_png_path}"
|
||||
|
||||
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")
|
||||
@@ -327,6 +335,10 @@ def main():
|
||||
' 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("{skel_wp_conf}", &loaded));\n'
|
||||
' assert(loaded.type == GEMINUX_WP_IMAGE && loaded.mode == GEMINUX_WP_FILL);\n'
|
||||
' assert(strcmp(loaded.path, "/usr/share/geminux/wallpapers/geminux-dark.png") == 0);\n'
|
||||
' assert(loaded.use_theme_bg);\n'
|
||||
f' assert(!geminux_wp_cfg_load("{wp_conf}", &loaded));\n'
|
||||
' geminux_wp_cfg_init(&cfg);\n'
|
||||
' cfg.type = GEMINUX_WP_IMAGE;\n'
|
||||
@@ -355,6 +367,7 @@ def main():
|
||||
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", "/etc/skel/.config/geminux/wallpaper.conf"),
|
||||
("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"),
|
||||
|
||||
Reference in new issue
Block a user