Synchronize active GTK2 and GTK3 themes with .xth theme selection

This commit is contained in:
Luxferre committed 2026-11-25 19:01:45 +02:00
1 parent 21485612fb
commit 16fcaaaba6
16 files changed
+949 -16

No files matched your search

+2 -1
View File
@@ -18,7 +18,8 @@ Geminux combines a custom-patched Linux `7.3.5` kernel, pure-Linux MTK flasher,
- `dwm` with Pango/HarfBuzz multi-font bar (`drw.c`), EWMH/XEmbed system tray, touch-friendly `>= 68px` status bar, `Mod4 = Fn+Alt` + one-shot `Super_L` tap-latch, `Fn+F` (`XF86XK_UWB`/`XF86XK_RFKill`) hardware Airplane Mode binding, `SIGHUP` self-reexec, and `SIGUSR1` `.Xresources` reload. - `dwm` with Pango/HarfBuzz multi-font bar (`drw.c`), EWMH/XEmbed system tray, touch-friendly `>= 68px` status bar, `Mod4 = Fn+Alt` + one-shot `Super_L` tap-latch, `Fn+F` (`XF86XK_UWB`/`XF86XK_RFKill`) hardware Airplane Mode binding, `SIGHUP` self-reexec, and `SIGUSR1` `.Xresources` reload.
- `dmenu` with Pango/HarfBuzz, dynamic full-screen-height item rows (`68px` touch rows), and mouse/touch click selection, paired with `geminux-launcher` pinning the 11 GUI apps alongside `Webarchy Browser`, `Bantam AI agent`, and `Lynx Web Browser` in `st` (and wrapping `Terminal=true` `.desktop` entries in `st -e`). - `dmenu` with Pango/HarfBuzz, dynamic full-screen-height item rows (`68px` touch rows), and mouse/touch click selection, paired with `geminux-launcher` pinning the 11 GUI apps alongside `Webarchy Browser`, `Bantam AI agent`, and `Lynx Web Browser` in `st` (and wrapping `Terminal=true` `.desktop` entries in `st -e`).
- **Zero-Rust notifications**: `dunst v1.12.2` compiled with `WAYLAND=0 DUNSTIFY=0` and custom pure-C PNG (`libpng` + Cairo) / JPEG (`libjpeg-turbo`) icon loader replacing `gdk-pixbuf` ([src/dunst-notify/](file:///home/lux/proj/geminux/src/dunst-notify/)), paired with a lightweight GDBus `notify-send` / `dunstify`. - **Zero-Rust notifications**: `dunst v1.12.2` compiled with `WAYLAND=0 DUNSTIFY=0` and custom pure-C PNG (`libpng` + Cairo) / JPEG (`libjpeg-turbo`) icon loader replacing `gdk-pixbuf` ([src/dunst-notify/](file:///home/lux/proj/geminux/src/dunst-notify/)), paired with a lightweight GDBus `notify-send` / `dunstify`.
- **Webarchy & pure-C `gdk-pixbuf`**: [src/webarchy/webarchy.cpp](file:///home/lux/proj/geminux/src/webarchy/webarchy.cpp) provides a standalone C++20 `GTK3` + `WebKit2GTK-4.1` multi-tab browser adapted for the `2160x1080` ultrawide display (`1080x506` logical @ `GDK_SCALE=2`) with a collapsible flush-right vertical tab bar, DPI-scaled `pt` CSS reloaded live from `~/.Xresources` via `SIGUSR1`, persistent SQLite cookies/bookmarks under `~/.local/share/geminux/webarchy` and `~/.config/geminux/webarchy`, single-instance FIFO URL forwarding, and automatic CPU renderer fallback on WebProcess crash. [scripts/build-webarchy.sh](file:///home/lux/proj/geminux/scripts/build-webarchy.sh) also cross-compiles pure-C GNOME `gdk-pixbuf 2.42.12` (`-Dbuiltin_loaders=all`, zero `libglycin`/`librsvg`) so `gtk+3.0` and `gst-plugins-good` install cleanly without Rust, and [scripts/compile-gsettings-schemas.sh](file:///home/lux/proj/geminux/scripts/compile-gsettings-schemas.sh) compiles `/usr/share/glib-2.0/schemas/gschemas.compiled` for `WebKitNetworkProcess`. - **Unified desktop & GTK2/GTK3 theming**: Switching `.xth` palettes via `geminux-themes` or `geminux-apply-theme` updates `~/.Xresources`, `xrdb`, `dunstrc` (`geminux-sync-dunst-theme`), and generates a light- or dark-based `Geminux-<Theme>` GTK2 (`gtk-2.0/gtkrc`, `~/.gtkrc-2.0`) and GTK3 (`gtk-3.0/gtk.css`, `~/.config/gtk-3.0/settings.ini`, `~/.config/xsettingsd/xsettingsd.conf`) theme via `geminux-sync-gtk-theme`, sending `SIGHUP` to `xsettingsd` and `SIGUSR1` to live `dwm`, `st`, `webarchy`, and `libgemui` clients for instant in-place reload.
- **Webarchy & pure-C `gdk-pixbuf`**: [src/webarchy/webarchy.cpp](file:///home/lux/proj/geminux/src/webarchy/webarchy.cpp) provides a standalone C++20 `GTK3` + `WebKit2GTK-4.1` multi-tab browser adapted for the `2160x1080` ultrawide display (`1080x506` logical @ `GDK_SCALE=2`) with a collapsible flush-right vertical tab bar, DPI-scaled `pt` CSS reloaded live from `~/.Xresources` via `SIGUSR1` (selecting the generated `Geminux-<Theme>` GTK3 theme and dark/light preference dynamically), persistent SQLite cookies/bookmarks under `~/.local/share/geminux/webarchy` and `~/.config/geminux/webarchy`, single-instance FIFO URL forwarding, and automatic CPU renderer fallback on WebProcess crash. [scripts/build-webarchy.sh](file:///home/lux/proj/geminux/scripts/build-webarchy.sh) also cross-compiles pure-C GNOME `gdk-pixbuf 2.42.12` (`-Dbuiltin_loaders=all`, zero `libglycin`/`librsvg`) so `gtk+3.0` and `gst-plugins-good` install cleanly without Rust, and [scripts/compile-gsettings-schemas.sh](file:///home/lux/proj/geminux/scripts/compile-gsettings-schemas.sh) compiles `/usr/share/glib-2.0/schemas/gschemas.compiled` for `WebKitNetworkProcess`.
- **Native media & `yt-dlp` stack**: Native Alpine Edge `mpv` (configured via [overlay/rootfs/etc/mpv/mpv.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/mpv/mpv.conf) for Panfrost X11 EGL, PipeWire/Pulse/ALSA, and `/tmp/geminux-mpv.sock` media-key IPC), `ffmpeg`/`ffprobe`, and `gst-libav` (for WebKit HTML5 media), paired with `mpg123`, `openmpt123`, `python3`/`py3-pip`, and `yt-dlp-core` + `yt-dlp-ejs-rt-quickjs` (`quickjs`, avoiding `deno`/`py3-cryptography`). - **Native media & `yt-dlp` stack**: Native Alpine Edge `mpv` (configured via [overlay/rootfs/etc/mpv/mpv.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/mpv/mpv.conf) for Panfrost X11 EGL, PipeWire/Pulse/ALSA, and `/tmp/geminux-mpv.sock` media-key IPC), `ffmpeg`/`ffprobe`, and `gst-libav` (for WebKit HTML5 media), paired with `mpg123`, `openmpt123`, `python3`/`py3-pip`, and `yt-dlp-core` + `yt-dlp-ejs-rt-quickjs` (`quickjs`, avoiding `deno`/`py3-cryptography`).
## Custom UI toolkit and zero-poll C11 daemons ## Custom UI toolkit and zero-poll C11 daemons
+1 -1
View File
@@ -54,7 +54,7 @@ geminux-apply-theme # list available themes
geminux-apply-theme TokyoNight geminux-apply-theme TokyoNight
``` ```
`geminux-apply-theme` updates `~/.Xresources`, merges into the X11 resource database via `xrdb`, translates the unified `theme.*` keys into `~/.config/dunst/dunstrc` via `geminux-sync-dunst-theme`, restarts `dunst`, and sends `SIGUSR1` to live `dwm`, `st`, `webarchy`, and `libgemui` applications for instant in-place redraw. `geminux-apply-theme` updates `~/.Xresources`, merges into the X11 resource database via `xrdb`, translates the unified `theme.*` keys into `~/.config/dunst/dunstrc` via `geminux-sync-dunst-theme`, generates a matching `Geminux-<Theme>` GTK2/GTK3 theme (selecting an Adwaita dark or light base from `theme.bgMain` luminance) under `~/.themes/` / `~/.local/share/themes/` and updates `~/.gtkrc-2.0`, `~/.config/gtk-3.0/settings.ini`, and `~/.config/xsettingsd/xsettingsd.conf` via `geminux-sync-gtk-theme`, restarts `dunst`, `SIGHUP`s `xsettingsd` for live GTK2/GTK3 reloading, and sends `SIGUSR1` to live `dwm`, `st`, `webarchy`, and `libgemui` applications for instant in-place redraw.
## Applications and daemons ## Applications and daemons
+1 -1
View File
@@ -45,7 +45,7 @@ Closing the Gemini PDA clamshell (`SW_LID = 1`) suspends immediately to RAM (`me
- **Audio**: PipeWire uses `default.clock.min-quantum = 1024` and `quantum = 2048` (`10-geminux-power.conf`); WirePlumber suspends idle ALSA and BlueZ nodes after `3` seconds (`50-geminux-suspend.conf`) so audio DSP clocks gate quickly. - **Audio**: PipeWire uses `default.clock.min-quantum = 1024` and `quantum = 2048` (`10-geminux-power.conf`); WirePlumber suspends idle ALSA and BlueZ nodes after `3` seconds (`50-geminux-suspend.conf`) so audio DSP clocks gate quickly.
- **Bluetooth**: BlueZ disables automatic adapter enable and fast page scan (`AutoEnable = false`, `FastConnectable = false` in [etc/bluetooth/main.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/bluetooth/main.conf)), and `geminux-hwinit` runs `rfkill block bluetooth` after loading `btmt6797`; users toggle Bluetooth on demand via `geminux-net`. - **Bluetooth**: BlueZ disables automatic adapter enable and fast page scan (`AutoEnable = false`, `FastConnectable = false` in [etc/bluetooth/main.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/bluetooth/main.conf)), and `geminux-hwinit` runs `rfkill block bluetooth` after loading `btmt6797`; users toggle Bluetooth on demand via `geminux-net`.
- **Wi-Fi & NTP**: NetworkManager configures `wifi.powersave = 2` (`10-geminux-power.conf`) to keep CONSYS Wi-Fi awake while associated so GTK rekeys, ARP, and DNS never stall; `geminux-powerd` powers down CONSYS cleanly across system suspend. [etc/chrony/sources.d/10-geminux.sources](file:///home/lux/proj/geminux/overlay/rootfs/etc/chrony/sources.d/10-geminux.sources) caps NTP pool peers (`maxsources 2`) and lengthens polling (`minpoll 10 maxpoll 14`), paired with an offline hook on `down|vpn-down` in [30-geminux-chrony](file:///home/lux/proj/geminux/overlay/rootfs/etc/NetworkManager/dispatcher.d/30-geminux-chrony). - **Wi-Fi & NTP**: NetworkManager configures `wifi.powersave = 2` (`10-geminux-power.conf`) to keep CONSYS Wi-Fi awake while associated so GTK rekeys, ARP, and DNS never stall; `geminux-powerd` powers down CONSYS cleanly across system suspend. [etc/chrony/sources.d/10-geminux.sources](file:///home/lux/proj/geminux/overlay/rootfs/etc/chrony/sources.d/10-geminux.sources) caps NTP pool peers (`maxsources 2`) and lengthens polling (`minpoll 10 maxpoll 14`), paired with an offline hook on `down|vpn-down` in [30-geminux-chrony](file:///home/lux/proj/geminux/overlay/rootfs/etc/NetworkManager/dispatcher.d/30-geminux-chrony).
- **GTK / D-Bus**: [etc/profile.d/10-geminux-env.sh](file:///home/lux/proj/geminux/overlay/rootfs/etc/profile.d/10-geminux-env.sh) exports `NO_AT_BRIDGE=1` so GTK3/`webarchy` never auto-activate AT-SPI accessibility bridge daemons. - **GTK / XSETTINGS / D-Bus**: [etc/profile.d/10-geminux-env.sh](file:///home/lux/proj/geminux/overlay/rootfs/etc/profile.d/10-geminux-env.sh) exports `NO_AT_BRIDGE=1` so GTK3/`webarchy` never auto-activate AT-SPI accessibility bridge daemons, and `geminux-session` runs `xsettingsd` as an event-driven X11 `XSETTINGS` selection daemon (`SIGHUP` on theme switch) with zero polling timers.
- **Storage**: `noatime,commit=60` in `etc/fstab` alongside `vm.dirty_writeback_centisecs=1500` reduces eMMC write amplification and wakes; microSD mounts at `/media/sdcard` likewise mount with `noatime` and rely purely on `eudev` hotplug events (`95-geminux-sdcard.rules`) with zero background polling when idle or empty. - **Storage**: `noatime,commit=60` in `etc/fstab` alongside `vm.dirty_writeback_centisecs=1500` reduces eMMC write amplification and wakes; microSD mounts at `/media/sdcard` likewise mount with `noatime` and rely purely on `eudev` hotplug events (`95-geminux-sdcard.rules`) with zero background polling when idle or empty.
## Auditing on device ## Auditing on device
+3 -3
View File
@@ -19,8 +19,8 @@ Geminux is an Alpine Linux (`aarch64`, musl, OpenRC) distribution built specific
| Flasher & GPT | Vendored GPLv3 `mtkclient` + MT6797 DA + GPT builder + offline credential & LUKS2 provisioning | [flash-mtk.sh](file:///home/lux/proj/geminux/flash-mtk.sh), [flash-mtk.py](file:///home/lux/proj/geminux/flash-mtk.py), [scripts/geminux_accounts.py](file:///home/lux/proj/geminux/scripts/geminux_accounts.py), [scripts/geminux_luks.py](file:///home/lux/proj/geminux/scripts/geminux_luks.py) | | Flasher & GPT | Vendored GPLv3 `mtkclient` + MT6797 DA + GPT builder + offline credential & LUKS2 provisioning | [flash-mtk.sh](file:///home/lux/proj/geminux/flash-mtk.sh), [flash-mtk.py](file:///home/lux/proj/geminux/flash-mtk.py), [scripts/geminux_accounts.py](file:///home/lux/proj/geminux/scripts/geminux_accounts.py), [scripts/geminux_luks.py](file:///home/lux/proj/geminux/scripts/geminux_luks.py) |
| Display server | XLibre Xorg 25.x (`modesetting` `ShadowFB` + `TearFree` rotated 2D scanout alongside Panfrost Glamor/EGL 3D, `fbdev`, `libinput`) | [scripts/build-xlibre.sh](file:///home/lux/proj/geminux/scripts/build-xlibre.sh) | | Display server | XLibre Xorg 25.x (`modesetting` `ShadowFB` + `TearFree` rotated 2D scanout alongside Panfrost Glamor/EGL 3D, `fbdev`, `libinput`) | [scripts/build-xlibre.sh](file:///home/lux/proj/geminux/scripts/build-xlibre.sh) |
| Window manager & terminal | Patched `dwm` (Pango, systray, `.Xresources`, `Mod4`, `Fn+F` Airplane Mode keybind, `SIGHUP` self-reexec), `st` (HarfBuzz ligatures, focus cursor sync & unfocused cursor-blink gating, wheel scrollback), full-height `dmenu` | [scripts/build-suckless.sh](file:///home/lux/proj/geminux/scripts/build-suckless.sh) | | Window manager & terminal | Patched `dwm` (Pango, systray, `.Xresources`, `Mod4`, `Fn+F` Airplane Mode keybind, `SIGHUP` self-reexec), `st` (HarfBuzz ligatures, focus cursor sync & unfocused cursor-blink gating, wheel scrollback), full-height `dmenu` | [scripts/build-suckless.sh](file:///home/lux/proj/geminux/scripts/build-suckless.sh) |
| Notifications | Pure-X11 zero-`gdk-pixbuf` `dunst v1.12.2` + custom GDBus `notify-send` / `dunstify` | [scripts/build-dunst.sh](file:///home/lux/proj/geminux/scripts/build-dunst.sh) | | Notifications | Pure-X11 zero-`gdk-pixbuf` `dunst v1.12.2` + custom GDBus `notify-send` / `dunstify` (`geminux-sync-dunst-theme`) | [scripts/build-dunst.sh](file:///home/lux/proj/geminux/scripts/build-dunst.sh) |
| Web browser | Webarchy C++20 `GTK3` + `WebKit2GTK-4.1` ultrawide browser (right-side vertical tab bar, DPI-scaled `.Xresources` `SIGUSR1` theming) + pure-C `gdk-pixbuf 2.42.12` | [scripts/build-webarchy.sh](file:///home/lux/proj/geminux/scripts/build-webarchy.sh), [scripts/compile-gsettings-schemas.sh](file:///home/lux/proj/geminux/scripts/compile-gsettings-schemas.sh) | | Web browser | Webarchy C++20 `GTK3` + `WebKit2GTK-4.1` ultrawide browser (right-side vertical tab bar, DPI-scaled `.Xresources` `SIGUSR1` theming, live `xsettingsd` / `Geminux-*` GTK2/GTK3 sync) + pure-C `gdk-pixbuf 2.42.12` | [scripts/build-webarchy.sh](file:///home/lux/proj/geminux/scripts/build-webarchy.sh), [scripts/compile-gsettings-schemas.sh](file:///home/lux/proj/geminux/scripts/compile-gsettings-schemas.sh) |
| UI & system daemons | `libgemui.so`, 11 landscape HiDPI apps (`geminux-net` Cellular/eSIM/DNS + Airplane Mode banner), zero-poll C11 daemons (`geminux-cellctl` dual-SIM / ST33 `lpac` eSIM + `ccmni*` PDN, `geminux-imsd` VoLTE/VoWiFi `SWu`/SMS-over-IMS/RTP, `geminux-powerd` hardware Airplane Mode, `geminux-dnsctl`, etc.) | [scripts/build-geminux-ui.sh](file:///home/lux/proj/geminux/scripts/build-geminux-ui.sh) | | UI & system daemons | `libgemui.so`, 11 landscape HiDPI apps (`geminux-net` Cellular/eSIM/DNS + Airplane Mode banner), zero-poll C11 daemons (`geminux-cellctl` dual-SIM / ST33 `lpac` eSIM + `ccmni*` PDN, `geminux-imsd` VoLTE/VoWiFi `SWu`/SMS-over-IMS/RTP, `geminux-powerd` hardware Airplane Mode, `geminux-dnsctl`, etc.) | [scripts/build-geminux-ui.sh](file:///home/lux/proj/geminux/scripts/build-geminux-ui.sh) |
| Media & CLI tools | Native Alpine Edge `mpv` (`/etc/mpv/mpv.conf` with Panfrost X11 EGL + PipeWire + IPC), `ffmpeg`/`ffprobe`, `gst-libav`, `mpg123`, `openmpt123`, `yt-dlp` (`quickjs`), `python3`/`pip3`, `gpg` (`gnupg`), `pass`, `dosfstools` (`mkfs.vfat`/`fsck.vfat`/`fatlabel`), `bantam`, `lynx`, `gsocket`, `.apexrc`, default `htoprc` | [scripts/build-bantam.sh](file:///home/lux/proj/geminux/scripts/build-bantam.sh), [scripts/build-gsocket.sh](file:///home/lux/proj/geminux/scripts/build-gsocket.sh), [overlay/rootfs/etc/mpv/mpv.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/mpv/mpv.conf) | | Media & CLI tools | Native Alpine Edge `mpv` (`/etc/mpv/mpv.conf` with Panfrost X11 EGL + PipeWire + IPC), `ffmpeg`/`ffprobe`, `gst-libav`, `mpg123`, `openmpt123`, `yt-dlp` (`quickjs`), `python3`/`pip3`, `gpg` (`gnupg`), `pass`, `dosfstools` (`mkfs.vfat`/`fsck.vfat`/`fatlabel`), `bantam`, `lynx`, `gsocket`, `.apexrc`, default `htoprc` | [scripts/build-bantam.sh](file:///home/lux/proj/geminux/scripts/build-bantam.sh), [scripts/build-gsocket.sh](file:///home/lux/proj/geminux/scripts/build-gsocket.sh), [overlay/rootfs/etc/mpv/mpv.conf](file:///home/lux/proj/geminux/overlay/rootfs/etc/mpv/mpv.conf) |
| Local APK repository | 10 signed `@geminux` `.apk` packages + `APKINDEX.tar.gz` | [scripts/package-local-apks.sh](file:///home/lux/proj/geminux/scripts/package-local-apks.sh) | | Local APK repository | 10 signed `@geminux` `.apk` packages + `APKINDEX.tar.gz` | [scripts/package-local-apks.sh](file:///home/lux/proj/geminux/scripts/package-local-apks.sh) |
@@ -36,7 +36,7 @@ Geminux is an Alpine Linux (`aarch64`, musl, OpenRC) distribution built specific
## Verification status vs. on-device testing ## Verification status vs. on-device testing
All cross-compiled binaries, kernel/DTB artifacts, GPT repartitioning logic, offline credential/LUKS2 builders, XKB keymap compilation, `.Xresources`-to-`dunstrc` theme syncing, MT6797 CCCI framing/handshake unit tests, 3GPP IMS/AKA/ESP/SIP/RTP protocol tests ([scripts/test-ims-protocol.py](file:///home/lux/proj/geminux/scripts/test-ims-protocol.py)), zero-poll power policy tests, Webarchy renderer profile & WebKit GSettings schema tests, `dosfstools` & `/media/sdcard` automount tests, ELF binary Rust scan, and `apk upgrade --simulate` checks are verified automatically via [scripts/check-rebuild.sh](file:///home/lux/proj/geminux/scripts/check-rebuild.sh). All cross-compiled binaries, kernel/DTB artifacts, GPT repartitioning logic, offline credential/LUKS2 builders, XKB keymap compilation, `.Xresources`-to-`dunstrc`/GTK2/GTK3 theme syncing, MT6797 CCCI framing/handshake unit tests, 3GPP IMS/AKA/ESP/SIP/RTP protocol tests ([scripts/test-ims-protocol.py](file:///home/lux/proj/geminux/scripts/test-ims-protocol.py)), zero-poll power policy tests, Webarchy renderer profile & WebKit GSettings schema tests, `dosfstools` & `/media/sdcard` automount tests, ELF binary Rust scan, and `apk upgrade --simulate` checks are verified automatically via [scripts/check-rebuild.sh](file:///home/lux/proj/geminux/scripts/check-rebuild.sh).
Live hardware bring-up on a physical Planet Computers Gemini PDA (x27 Wi-Fi + 4G) has been verified for USB BROM/DA flashing, offline account provisioning, LUKS2 full-disk encryption unlock & first-boot ext4 resize, `SSD2092` FHD+ display & multi-touch gestures (`geminux-touchd`), tear-free rotated `ShadowFB` scanout, lid-close S3 deep sleep & resume, CONSYS Wi-Fi/BT (`geminux-net` DNS tab & associated WLAN persistence), MT6797 MD1 baseband boot (`MD_STATE=READY`), ST33 eUICC / physical SIM slot switching & `geminux-imsd` standby, `Fn+F` hardware Airplane Mode radio teardown/restore, Webarchy ultrawide Panfrost GPU rendering, PipeWire audio, Media Controller + 10-bit Bayer camera ISP, AW9120 RGB back LEDs, Chrony online time sync, and USB NCM networking. Accessory/carrier-dependent checks (such as live VoLTE/VoWiFi calls/SMS with an active carrier SIM/eUICC profile and external Slimport/HDMI monitors) are documented in the hardware checklist in [INSTALL.md](file:///home/lux/proj/geminux/INSTALL.md). Live hardware bring-up on a physical Planet Computers Gemini PDA (x27 Wi-Fi + 4G) has been verified for USB BROM/DA flashing, offline account provisioning, LUKS2 full-disk encryption unlock & first-boot ext4 resize, `SSD2092` FHD+ display & multi-touch gestures (`geminux-touchd`), tear-free rotated `ShadowFB` scanout, lid-close S3 deep sleep & resume, CONSYS Wi-Fi/BT (`geminux-net` DNS tab & associated WLAN persistence), MT6797 MD1 baseband boot (`MD_STATE=READY`), ST33 eUICC / physical SIM slot switching & `geminux-imsd` standby, `Fn+F` hardware Airplane Mode radio teardown/restore, Webarchy ultrawide Panfrost GPU rendering, PipeWire audio, Media Controller + 10-bit Bayer camera ISP, AW9120 RGB back LEDs, Chrony online time sync, and USB NCM networking. Accessory/carrier-dependent checks (such as live VoLTE/VoWiFi calls/SMS with an active carrier SIM/eUICC profile and external Slimport/HDMI monitors) are documented in the hardware checklist in [INSTALL.md](file:///home/lux/proj/geminux/INSTALL.md).
+2 -1
View File
@@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# Apply a Geminux .xth theme across .Xresources, xrdb, dunst, dwm, st, and libgemui apps. # Apply a Geminux .xth theme across .Xresources, xrdb, dunst, GTK2/GTK3, dwm, st, and libgemui apps.
set -eu set -eu
HOME_DIR="${HOME:-/home/user}" HOME_DIR="${HOME:-/home/user}"
@@ -30,6 +30,7 @@ if [ -n "${DISPLAY:-}" ] && command -v xrdb >/dev/null 2>&1; then
fi fi
/usr/bin/geminux-sync-dunst-theme /usr/bin/geminux-sync-dunst-theme
/usr/bin/geminux-sync-gtk-theme
# Signal live applications (dwm, st, webarchy, libgemui apps) to reload .Xresources via SIGUSR1 # Signal live applications (dwm, st, webarchy, libgemui apps) to reload .Xresources via SIGUSR1
for proc in dwm st webarchy geminux-dialer geminux-callscreen geminux-sms geminux-contacts \ for proc in dwm st webarchy geminux-dialer geminux-callscreen geminux-sms geminux-contacts \
+5
View File
@@ -50,6 +50,10 @@ if command -v geminux-sync-dunst-theme >/dev/null 2>&1; then
geminux-sync-dunst-theme 2>/dev/null || true geminux-sync-dunst-theme 2>/dev/null || true
fi fi
if command -v geminux-sync-gtk-theme >/dev/null 2>&1; then
geminux-sync-gtk-theme --no-reload 2>/dev/null || true
fi
if command -v xset >/dev/null 2>&1; then if command -v xset >/dev/null 2>&1; then
# Suspend and backlight blanking are managed event-driven by geminux-powerd. # Suspend and backlight blanking are managed event-driven by geminux-powerd.
xset s off -dpms 2>/dev/null || true xset s off -dpms 2>/dev/null || true
@@ -74,6 +78,7 @@ start_bg() {
start_bg pipewire start_bg pipewire
start_bg pipewire-pulse start_bg pipewire-pulse
start_bg wireplumber start_bg wireplumber
start_bg xsettingsd -c "$HOME_DIR/.config/xsettingsd/xsettingsd.conf"
start_bg dunst start_bg dunst
start_bg geminux-statusd start_bg geminux-statusd
start_bg geminux-touchd start_bg geminux-touchd
+796
View File
@@ -0,0 +1,796 @@
#!/bin/sh
# Synchronize active GTK2, GTK3, and xsettingsd themes/fonts with .Xresources/.xth theme.
set -eu
HOME_DIR="${HOME:-/home/user}"
XRES_FILE="${GEMINUX_XRESOURCES:-$HOME_DIR/.Xresources}"
if [ ! -r "$XRES_FILE" ] && [ -r /etc/skel/.Xresources ]; then
XRES_FILE="/etc/skel/.Xresources"
fi
THEMES_OUT_DIR="${GEMINUX_GTK_THEMES_DIR:-$HOME_DIR/.themes}"
XDG_THEMES_OUT_DIR="${GEMINUX_XDG_THEMES_DIR:-$HOME_DIR/.local/share/themes}"
GTK2_RC_OUT="${GEMINUX_GTK2_RC:-$HOME_DIR/.gtkrc-2.0}"
GTK3_CONF_DIR="${GEMINUX_GTK3_DIR:-$HOME_DIR/.config/gtk-3.0}"
XSETTINGSD_CONF="${GEMINUX_XSETTINGSD_CONF:-$HOME_DIR/.config/xsettingsd/xsettingsd.conf}"
get_xres() {
key="$1"
def="$2"
if [ -r "$XRES_FILE" ]; then
val="$(awk -F: -v k="$key" '
$0 !~ /^[[:space:]]*[!#]/ {
kpart = $1
gsub(/^[[:space:]]+|[[:space:]]+$/, "", kpart)
if (kpart == k) {
sub(/^[^:]*:[[:space:]]*/, "", $0)
gsub(/^[[:space:]"'\'']+|[[:space:]"'\'']+$/, "", $0)
print $0
}
}
' "$XRES_FILE" | tail -n 1)"
if [ -n "$val" ]; then
printf '%s' "$val"
return
fi
fi
printf '%s' "$def"
}
RAW_NAME="$(get_xres "theme.name" "GeminuxHelio")"
SAFE_NAME="$(printf '%s' "$RAW_NAME" | tr -cd 'A-Za-z0-9._-')"
[ -n "$SAFE_NAME" ] || SAFE_NAME="GeminuxHelio"
GTK_THEME_NAME="Geminux-$SAFE_NAME"
BG_MAIN="$(get_xres "theme.bgMain" "#0f1419")"
BG_BAR="$(get_xres "theme.bgBar" "$BG_MAIN")"
BG_HEADER="$(get_xres "theme.bgHeader" "$BG_MAIN")"
BG_FOOTER="$(get_xres "theme.bgFooter" "$BG_HEADER")"
BG_OVERLAY="$(get_xres "theme.bgOverlay" "$BG_HEADER")"
BG_ALT_EVEN="$(get_xres "theme.bgAltEven" "$BG_MAIN")"
BG_ALT_ODD="$(get_xres "theme.bgAltOdd" "$BG_ALT_EVEN")"
BG_INPUT="$(get_xres "theme.bgInput" "$BG_MAIN")"
BG_BUTTON="$(get_xres "theme.bgButton" "$BG_ALT_EVEN")"
BG_INPUT_FOCUS="$(get_xres "theme.bgInputFocus" "$BG_BUTTON")"
BG_SEARCH="$(get_xres "theme.bgSearch" "$BG_BUTTON")"
FG_MAIN="$(get_xres "theme.fgMain" "#e6e1cf")"
FG_BRIGHT="$(get_xres "theme.fgBright" "$FG_MAIN")"
FG_MUTED="$(get_xres "theme.fgMuted" "#7b8898")"
SEL_BG="$(get_xres "theme.selBg" "#2b5278")"
SEL_FG="$(get_xres "theme.selFg" "#ffffff")"
ACCENT="$(get_xres "theme.accent" "$SEL_BG")"
ACCENT_ALT="$(get_xres "theme.accentAlt" "$ACCENT")"
HIGHLIGHT="$(get_xres "theme.highlight" "$ACCENT")"
BORDER="$(get_xres "theme.border" "#283444")"
DIVIDER="$(get_xres "theme.divider" "$BORDER")"
SUCCESS="$(get_xres "theme.success" "#2ecc71")"
INFO="$(get_xres "theme.info" "#5dade2")"
WARNING="$(get_xres "theme.warning" "#e67e22")"
DANGER="$(get_xres "theme.danger" "#f07178")"
DANGER_BG="$(get_xres "theme.dangerBg" "#4c1d24")"
FONT_FACE="$(get_xres "theme.fontFace" "Fira Code" | tr -d '"')"
[ -n "$FONT_FACE" ] || FONT_FACE="Fira Code"
BASE_SIZE="$(get_xres "theme.baseFontSize" "32")"
case "$BASE_SIZE" in
''|*[!0-9]*) BASE_SIZE=32 ;;
esac
PT_SIZE="$(awk -v b="$BASE_SIZE" 'BEGIN {
pt = int(b * 10 / 32 + 0.5)
if (pt < 8) pt = 8
if (pt > 16) pt = 16
printf "%d", pt
}')"
GTK_FONT="$FONT_FACE $PT_SIZE"
CURSOR_THEME="$(get_xres "Xcursor.theme" "default" | tr -d '"')"
[ -n "$CURSOR_THEME" ] || CURSOR_THEME="default"
CURSOR_SIZE="$(get_xres "Xcursor.size" "64")"
case "$CURSOR_SIZE" in
''|*[!0-9]*) CURSOR_SIZE=64 ;;
esac
IS_DARK="$(awk -v h="$BG_MAIN" '
function hex2(s, i, a, b) {
s = tolower(s)
a = index("0123456789abcdef", substr(s, i, 1)) - 1
b = index("0123456789abcdef", substr(s, i + 1, 1)) - 1
if (a < 0 || b < 0) return -1
return a * 16 + b
}
BEGIN {
if (length(h) == 7 && substr(h, 1, 1) == "#") {
r = hex2(h, 2)
g = hex2(h, 4)
b = hex2(h, 6)
if (r >= 0 && g >= 0 && b >= 0) {
lum = 0.2126 * r + 0.7152 * g + 0.0722 * b
print (lum < 128.0) ? "1" : "0"
exit
}
}
print "1"
}
')"
if [ "$IS_DARK" = "1" ]; then
ADWAITA_IMPORT="resource:///org/gtk/libgtk/theme/Adwaita/gtk-contained-dark.css"
PREFER_DARK_BOOL="true"
COLOR_SCHEME="prefer-dark"
else
ADWAITA_IMPORT="resource:///org/gtk/libgtk/theme/Adwaita/gtk-contained.css"
PREFER_DARK_BOOL="false"
COLOR_SCHEME="prefer-light"
fi
PREV_THEME=""
if [ -r "$XSETTINGSD_CONF" ]; then
PREV_THEME="$(awk '$1 == "Net/ThemeName" {
sub(/^Net\/ThemeName[[:space:]]+/, "", $0)
gsub(/^"|"$/, "", $0)
print $0
exit
}' "$XSETTINGSD_CONF")"
fi
THEME_ROOT="$THEMES_OUT_DIR/$GTK_THEME_NAME"
mkdir -p "$THEME_ROOT/gtk-2.0" "$THEME_ROOT/gtk-3.0" \
"$XDG_THEMES_OUT_DIR" "$(dirname "$GTK2_RC_OUT")" \
"$GTK3_CONF_DIR" "$(dirname "$XSETTINGSD_CONF")"
cat > "$THEME_ROOT/index.theme.tmp.$$" <<EOF
[Desktop Entry]
Type=X-GNOME-Metatheme
Name=$GTK_THEME_NAME
Comment=Auto-generated Geminux GTK2/GTK3 theme from $RAW_NAME
Encoding=UTF-8
[X-GNOME-Metatheme]
GtkTheme=$GTK_THEME_NAME
IconTheme=hicolor
CursorTheme=$CURSOR_THEME
CursorSize=$CURSOR_SIZE
EOF
mv -f "$THEME_ROOT/index.theme.tmp.$$" "$THEME_ROOT/index.theme"
cat > "$THEME_ROOT/gtk-2.0/gtkrc.tmp.$$" <<EOF
# Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
gtk-color-scheme = "bg_color:$BG_MAIN\nfg_color:$FG_MAIN\nbase_color:$BG_INPUT\ntext_color:$FG_MAIN\nselected_bg_color:$SEL_BG\nselected_fg_color:$SEL_FG\ntooltip_bg_color:$BG_OVERLAY\ntooltip_fg_color:$FG_BRIGHT\nlink_color:$ACCENT"
style "geminux-default" {
xthickness = 2
ythickness = 2
GtkWidget::link-color = "$ACCENT"
GtkWidget::visited-link-color = "$ACCENT_ALT"
bg[NORMAL] = "$BG_MAIN"
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
bg[ACTIVE] = "$BG_ALT_ODD"
bg[SELECTED] = "$SEL_BG"
bg[INSENSITIVE] = "$BG_ALT_EVEN"
fg[NORMAL] = "$FG_MAIN"
fg[PRELIGHT] = "$FG_BRIGHT"
fg[ACTIVE] = "$FG_BRIGHT"
fg[SELECTED] = "$SEL_FG"
fg[INSENSITIVE] = "$FG_MUTED"
base[NORMAL] = "$BG_INPUT"
base[PRELIGHT] = "$BG_INPUT_FOCUS"
base[ACTIVE] = "$BG_ALT_ODD"
base[SELECTED] = "$SEL_BG"
base[INSENSITIVE] = "$BG_ALT_EVEN"
text[NORMAL] = "$FG_MAIN"
text[PRELIGHT] = "$FG_BRIGHT"
text[ACTIVE] = "$FG_BRIGHT"
text[SELECTED] = "$SEL_FG"
text[INSENSITIVE] = "$FG_MUTED"
}
style "geminux-button" = "geminux-default" {
xthickness = 4
ythickness = 3
bg[NORMAL] = "$BG_BUTTON"
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
bg[ACTIVE] = "$SEL_BG"
bg[INSENSITIVE] = "$BG_ALT_EVEN"
fg[NORMAL] = "$FG_BRIGHT"
fg[PRELIGHT] = "$FG_BRIGHT"
fg[ACTIVE] = "$SEL_FG"
fg[INSENSITIVE] = "$FG_MUTED"
}
style "geminux-entry" = "geminux-default" {
xthickness = 3
ythickness = 3
bg[NORMAL] = "$BG_INPUT"
bg[SELECTED] = "$SEL_BG"
bg[INSENSITIVE] = "$BG_ALT_EVEN"
base[NORMAL] = "$BG_INPUT"
base[ACTIVE] = "$BG_INPUT_FOCUS"
base[SELECTED] = "$SEL_BG"
base[INSENSITIVE] = "$BG_ALT_EVEN"
text[NORMAL] = "$FG_BRIGHT"
text[ACTIVE] = "$FG_BRIGHT"
text[SELECTED] = "$SEL_FG"
text[INSENSITIVE] = "$FG_MUTED"
}
style "geminux-menubar" = "geminux-default" {
bg[NORMAL] = "$BG_BAR"
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
bg[ACTIVE] = "$BG_HEADER"
bg[SELECTED] = "$SEL_BG"
fg[NORMAL] = "$FG_MAIN"
fg[PRELIGHT] = "$FG_BRIGHT"
fg[SELECTED] = "$SEL_FG"
}
style "geminux-menu" = "geminux-default" {
xthickness = 2
ythickness = 2
bg[NORMAL] = "$BG_OVERLAY"
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
bg[ACTIVE] = "$BG_INPUT_FOCUS"
bg[SELECTED] = "$SEL_BG"
fg[NORMAL] = "$FG_MAIN"
fg[PRELIGHT] = "$FG_BRIGHT"
fg[SELECTED] = "$SEL_FG"
}
style "geminux-menu-item" = "geminux-menu" {
xthickness = 4
ythickness = 3
bg[PRELIGHT] = "$SEL_BG"
bg[SELECTED] = "$SEL_BG"
fg[PRELIGHT] = "$SEL_FG"
fg[SELECTED] = "$SEL_FG"
}
style "geminux-notebook" = "geminux-default" {
bg[NORMAL] = "$BG_MAIN"
bg[ACTIVE] = "$BG_HEADER"
fg[NORMAL] = "$FG_BRIGHT"
fg[ACTIVE] = "$FG_MUTED"
}
style "geminux-treeview" = "geminux-default" {
base[NORMAL] = "$BG_ALT_EVEN"
base[ACTIVE] = "$SEL_BG"
base[SELECTED] = "$SEL_BG"
base[INSENSITIVE] = "$BG_ALT_EVEN"
text[NORMAL] = "$FG_MAIN"
text[ACTIVE] = "$SEL_FG"
text[SELECTED] = "$SEL_FG"
text[INSENSITIVE] = "$FG_MUTED"
}
style "geminux-scrollbar" = "geminux-default" {
bg[NORMAL] = "$DIVIDER"
bg[PRELIGHT] = "$ACCENT"
bg[ACTIVE] = "$SEL_BG"
bg[INSENSITIVE] = "$BG_BAR"
}
style "geminux-progressbar" = "geminux-default" {
bg[NORMAL] = "$BG_SEARCH"
bg[PRELIGHT] = "$ACCENT"
bg[SELECTED] = "$ACCENT"
fg[NORMAL] = "$FG_BRIGHT"
fg[SELECTED] = "$SEL_FG"
}
style "geminux-tooltip" = "geminux-default" {
xthickness = 4
ythickness = 4
bg[NORMAL] = "$BG_OVERLAY"
fg[NORMAL] = "$FG_BRIGHT"
}
class "GtkWidget" style "geminux-default"
class "GtkButton" style "geminux-button"
widget_class "*.<GtkButton>*" style "geminux-button"
class "GtkEntry" style "geminux-entry"
class "GtkTextView" style "geminux-entry"
class "GtkSpinButton" style "geminux-entry"
class "GtkMenuBar" style "geminux-menubar"
class "GtkToolbar" style "geminux-menubar"
class "GtkMenu" style "geminux-menu"
widget_class "*<GtkMenu>*" style "geminux-menu"
class "GtkMenuItem" style "geminux-menu-item"
widget_class "*<GtkMenuItem>*" style "geminux-menu-item"
class "GtkNotebook" style "geminux-notebook"
class "GtkTreeView" style "geminux-treeview"
widget_class "*.<GtkTreeView>*" style "geminux-treeview"
class "GtkScrollbar" style "geminux-scrollbar"
class "GtkProgressBar" style "geminux-progressbar"
widget "gtk-tooltip*" style "geminux-tooltip"
EOF
mv -f "$THEME_ROOT/gtk-2.0/gtkrc.tmp.$$" "$THEME_ROOT/gtk-2.0/gtkrc"
cat > "$THEME_ROOT/gtk-3.0/gtk.css.tmp.$$" <<EOF
/* Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME) */
@import url("$ADWAITA_IMPORT");
@define-color theme_fg_color $FG_MAIN;
@define-color theme_text_color $FG_BRIGHT;
@define-color theme_bg_color $BG_MAIN;
@define-color theme_base_color $BG_INPUT;
@define-color theme_selected_bg_color $SEL_BG;
@define-color theme_selected_fg_color $SEL_FG;
@define-color insensitive_bg_color $BG_ALT_EVEN;
@define-color insensitive_fg_color $FG_MUTED;
@define-color insensitive_base_color $BG_ALT_EVEN;
@define-color theme_unfocused_fg_color $FG_MUTED;
@define-color theme_unfocused_text_color $FG_MAIN;
@define-color theme_unfocused_bg_color $BG_MAIN;
@define-color theme_unfocused_base_color $BG_ALT_EVEN;
@define-color theme_unfocused_selected_bg_color $SEL_BG;
@define-color theme_unfocused_selected_fg_color $SEL_FG;
@define-color unfocused_insensitive_color $FG_MUTED;
@define-color borders $BORDER;
@define-color unfocused_borders $DIVIDER;
@define-color warning_color $WARNING;
@define-color error_color $DANGER;
@define-color success_color $SUCCESS;
@define-color link_color $ACCENT;
@define-color visited_link_color $ACCENT_ALT;
@define-color content_view_bg $BG_INPUT;
@define-color text_view_bg $BG_INPUT;
@define-color wm_bg_a $BG_HEADER;
@define-color wm_bg_b $BG_BAR;
@define-color wm_border $BORDER;
* {
caret-color: $ACCENT;
outline-color: $ACCENT;
}
window,
window.background,
dialog,
messagedialog,
.background {
background-color: $BG_MAIN;
color: $FG_MAIN;
}
window:backdrop,
.background:backdrop {
background-color: $BG_MAIN;
color: $FG_MUTED;
}
headerbar,
.titlebar,
toolbar,
.primary-toolbar,
actionbar,
searchbar {
background-image: none;
background-color: $BG_HEADER;
color: $FG_BRIGHT;
border-color: $BORDER;
box-shadow: none;
}
headerbar:backdrop,
.titlebar:backdrop {
background-color: $BG_BAR;
color: $FG_MUTED;
border-color: $BORDER;
}
menubar,
.menubar {
background-image: none;
background-color: $BG_BAR;
color: $FG_MAIN;
border-bottom: 1px solid $BORDER;
}
statusbar,
.statusbar {
background-color: $BG_BAR;
color: $FG_MUTED;
border-top: 1px solid $BORDER;
}
menu,
.menu,
.context-menu,
popover,
popover.background {
background-image: none;
background-color: $BG_OVERLAY;
color: $FG_MAIN;
border: 1px solid $BORDER;
box-shadow: none;
}
menuitem,
modelbutton,
row.activatable {
color: $FG_MAIN;
}
menuitem:hover,
menuitem:selected,
modelbutton:hover,
row.activatable:hover {
background-image: none;
background-color: $BG_INPUT_FOCUS;
color: $FG_BRIGHT;
}
menuitem:disabled,
modelbutton:disabled,
label:disabled {
color: $FG_MUTED;
}
*:selected,
selection,
row:selected,
row.activatable:selected,
treeview.view:selected,
iconview:selected,
textview text selection,
entry selection,
label selection {
background-image: none;
background-color: $SEL_BG;
color: $SEL_FG;
}
button {
background-image: none;
background-color: $BG_BUTTON;
color: $FG_BRIGHT;
border: 1px solid $BORDER;
box-shadow: none;
}
button:hover {
background-image: none;
background-color: $BG_INPUT_FOCUS;
border-color: $ACCENT;
color: $FG_BRIGHT;
}
button:active,
button:checked {
background-image: none;
background-color: $SEL_BG;
color: $SEL_FG;
border-color: $ACCENT;
}
button:disabled {
background-image: none;
background-color: $BG_ALT_EVEN;
color: $FG_MUTED;
border-color: $DIVIDER;
}
button.flat,
button.titlebutton {
background-color: transparent;
border-color: transparent;
box-shadow: none;
color: $FG_MAIN;
}
button.flat:hover,
button.titlebutton:hover {
background-color: $BG_INPUT_FOCUS;
border-color: $BORDER;
color: $FG_BRIGHT;
}
button.suggested-action {
background-image: none;
background-color: $SEL_BG;
color: $SEL_FG;
border-color: $ACCENT;
}
button.destructive-action {
background-image: none;
background-color: $DANGER_BG;
color: $FG_BRIGHT;
border-color: $DANGER;
}
entry,
spinbutton {
background-image: none;
background-color: $BG_INPUT;
color: $FG_BRIGHT;
border: 1px solid $BORDER;
box-shadow: none;
caret-color: $ACCENT;
}
entry:focus,
spinbutton:focus {
background-color: $BG_INPUT_FOCUS;
border-color: $ACCENT;
}
entry:disabled,
spinbutton:disabled {
background-color: $BG_ALT_EVEN;
color: $FG_MUTED;
}
textview,
textview text,
.view,
iconview {
background-color: $BG_INPUT;
color: $FG_MAIN;
}
treeview.view {
background-color: $BG_ALT_EVEN;
color: $FG_MAIN;
}
treeview.view header button {
background-image: none;
background-color: $BG_HEADER;
color: $FG_MAIN;
border-color: $BORDER;
}
list,
listbox,
.list-row,
row {
background-color: $BG_ALT_EVEN;
color: $FG_MAIN;
border-color: $DIVIDER;
}
notebook {
background-color: $BG_MAIN;
border-color: $BORDER;
}
notebook > header {
background-image: none;
background-color: $BG_BAR;
border-color: $BORDER;
}
notebook > header tab {
background-image: none;
background-color: $BG_HEADER;
color: $FG_MUTED;
border-color: $BORDER;
}
notebook > header tab:hover {
color: $FG_MAIN;
background-color: $BG_ALT_EVEN;
}
notebook > header tab:checked {
background-color: $BG_MAIN;
color: $FG_BRIGHT;
border-color: $ACCENT;
}
checkbutton check,
radiobutton radio {
background-color: $BG_INPUT;
border-color: $BORDER;
color: $SEL_FG;
}
checkbutton check:checked,
radiobutton radio:checked,
modelbutton check:checked,
modelbutton radio:checked {
background-image: none;
background-color: $SEL_BG;
border-color: $ACCENT;
color: $SEL_FG;
}
switch {
background-image: none;
background-color: $BG_BUTTON;
border: 1px solid $BORDER;
color: $FG_MAIN;
}
switch:checked {
background-image: none;
background-color: $SEL_BG;
border-color: $ACCENT;
color: $SEL_FG;
}
switch slider {
background-image: none;
background-color: $FG_BRIGHT;
border: 1px solid $BORDER;
}
progressbar trough,
scale trough {
background-image: none;
background-color: $BG_SEARCH;
border: 1px solid $BORDER;
}
progressbar progress,
scale highlight {
background-image: none;
background-color: $ACCENT;
border-color: $ACCENT;
}
scale slider {
background-image: none;
background-color: $FG_BRIGHT;
border: 1px solid $ACCENT;
}
scrollbar {
background-color: $BG_BAR;
border-color: $BORDER;
}
scrollbar trough {
background-color: $BG_BAR;
}
scrollbar slider {
background-image: none;
background-color: $DIVIDER;
}
scrollbar slider:hover {
background-color: $ACCENT;
}
scrollbar slider:active {
background-color: $SEL_BG;
}
tooltip,
tooltip.background,
.tooltip {
background-image: none;
background-color: $BG_OVERLAY;
color: $FG_BRIGHT;
border: 1px solid $ACCENT;
}
separator,
.separator {
background-color: $DIVIDER;
color: $DIVIDER;
}
frame > border,
scrolledwindow > border,
.frame {
border-color: $BORDER;
}
*:link {
color: $ACCENT;
}
*:visited {
color: $ACCENT_ALT;
}
infobar.info {
background-color: $SEL_BG;
color: $SEL_FG;
}
infobar.warning {
background-color: $BG_OVERLAY;
color: $WARNING;
border-color: $WARNING;
}
infobar.error {
background-color: $DANGER_BG;
color: $FG_BRIGHT;
border-color: $DANGER;
}
EOF
mv -f "$THEME_ROOT/gtk-3.0/gtk.css.tmp.$$" "$THEME_ROOT/gtk-3.0/gtk.css"
cat > "$THEME_ROOT/gtk-3.0/gtk-dark.css.tmp.$$" <<EOF
@import url("gtk.css");
EOF
mv -f "$THEME_ROOT/gtk-3.0/gtk-dark.css.tmp.$$" "$THEME_ROOT/gtk-3.0/gtk-dark.css"
if [ "$THEMES_OUT_DIR" = "$HOME_DIR/.themes" ] && [ "$XDG_THEMES_OUT_DIR" = "$HOME_DIR/.local/share/themes" ]; then
ln -sfn "../../../.themes/$GTK_THEME_NAME" "$XDG_THEMES_OUT_DIR/$GTK_THEME_NAME"
else
ln -sfn "$THEME_ROOT" "$XDG_THEMES_OUT_DIR/$GTK_THEME_NAME"
fi
cat > "$GTK2_RC_OUT.tmp.$$" <<EOF
# Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
gtk-theme-name="$GTK_THEME_NAME"
gtk-icon-theme-name="hicolor"
gtk-font-name="$GTK_FONT"
gtk-cursor-theme-name="$CURSOR_THEME"
gtk-cursor-theme-size=$CURSOR_SIZE
gtk-toolbar-style=GTK_TOOLBAR_ICONS
EOF
mv -f "$GTK2_RC_OUT.tmp.$$" "$GTK2_RC_OUT"
cat > "$GTK3_CONF_DIR/settings.ini.tmp.$$" <<EOF
[Settings]
gtk-theme-name=$GTK_THEME_NAME
gtk-icon-theme-name=hicolor
gtk-font-name=$GTK_FONT
gtk-cursor-theme-name=$CURSOR_THEME
gtk-cursor-theme-size=$CURSOR_SIZE
gtk-application-prefer-dark-theme=$PREFER_DARK_BOOL
EOF
mv -f "$GTK3_CONF_DIR/settings.ini.tmp.$$" "$GTK3_CONF_DIR/settings.ini"
write_xsettingsd() {
cat > "$XSETTINGSD_CONF.tmp.$$" <<EOF
# Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
Net/ThemeName "$1"
Net/IconThemeName "hicolor"
Gtk/FontName "$GTK_FONT"
Gtk/CursorThemeName "$CURSOR_THEME"
Gtk/CursorThemeSize $CURSOR_SIZE
EOF
mv -f "$XSETTINGSD_CONF.tmp.$$" "$XSETTINGSD_CONF"
}
write_xsettingsd "$GTK_THEME_NAME"
if [ "${1:-}" != "--no-reload" ]; then
XSD_PIDS="$(pidof xsettingsd 2>/dev/null || true)"
if [ -n "$XSD_PIDS" ]; then
if [ "$PREV_THEME" = "$GTK_THEME_NAME" ]; then
write_xsettingsd "Adwaita"
for pid in $XSD_PIDS; do
kill -HUP "$pid" 2>/dev/null || true
done
sleep 0.05 2>/dev/null || sleep 1
write_xsettingsd "$GTK_THEME_NAME"
fi
for pid in $XSD_PIDS; do
kill -HUP "$pid" 2>/dev/null || true
done
elif [ -n "${DISPLAY:-}" ] && command -v xsettingsd >/dev/null 2>&1; then
xsettingsd -c "$XSETTINGSD_CONF" >/dev/null 2>&1 </dev/null &
fi
if [ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v gsettings >/dev/null 2>&1; then
gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME_NAME" 2>/dev/null || true
gsettings set org.gnome.desktop.interface color-scheme "$COLOR_SCHEME" 2>/dev/null || true
gsettings set org.gnome.desktop.interface font-name "$GTK_FONT" 2>/dev/null || true
fi
fi
Binary file not shown.
Binary file not shown.
+5
View File
@@ -217,6 +217,11 @@ mkdir -p "$TARGET_ROOTFS/home/user/.cache" "$TARGET_ROOTFS/home/user/.config" \
"$TARGET_ROOTFS/home/user/.local/share/geminux" \ "$TARGET_ROOTFS/home/user/.local/share/geminux" \
"$TARGET_ROOTFS/home/user/Pictures" "$TARGET_ROOTFS/home/user/Videos" \ "$TARGET_ROOTFS/home/user/Pictures" "$TARGET_ROOTFS/home/user/Videos" \
"$TARGET_ROOTFS/home/user/Downloads" "$TARGET_ROOTFS/home/user/Downloads"
if [ -x "$TARGET_ROOTFS/usr/bin/geminux-sync-gtk-theme" ]; then
HOME="$TARGET_ROOTFS/etc/skel" \
GEMINUX_XRESOURCES="$TARGET_ROOTFS/etc/skel/.Xresources" \
"$TARGET_ROOTFS/usr/bin/geminux-sync-gtk-theme" --no-reload
fi
if [ -d "$TARGET_ROOTFS/etc/skel" ]; then if [ -d "$TARGET_ROOTFS/etc/skel" ]; then
cp -af "$TARGET_ROOTFS/etc/skel/." "$TARGET_ROOTFS/home/user/" cp -af "$TARGET_ROOTFS/etc/skel/." "$TARGET_ROOTFS/home/user/"
fi fi
+10 -1
View File
@@ -34,7 +34,7 @@ for bad_pkg in sway wayfire weston phosh cage xwayland grim slurp wofi \
exit 1 exit 1
fi fi
done done
for req_pkg in ffmpeg mpv gst-libav; do for req_pkg in ffmpeg mpv gst-libav xsettingsd; do
if ! grep -Fxq "P:$req_pkg" "$ROOTFS_DIR/lib/apk/db/installed"; then 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 echo "FAIL: expected native package '$req_pkg' is not installed in rootfs" >&2
exit 1 exit 1
@@ -364,6 +364,15 @@ for req_rel in ("etc/pam.d/autologin", "etc/init.d/geminux-hwinit",
"root/.config/htop/htoprc", "root/.config/htop/htoprc",
"root/.lynx.cfg", "root/.lynx.cfg",
"root/.apexrc", "root/.apexrc",
"usr/bin/xsetroot",
"usr/bin/xsettingsd",
"usr/bin/geminux-sync-gtk-theme",
"etc/skel/.gtkrc-2.0",
"etc/skel/.config/gtk-3.0/settings.ini",
"etc/skel/.config/xsettingsd/xsettingsd.conf",
"home/user/.gtkrc-2.0",
"home/user/.config/gtk-3.0/settings.ini",
"home/user/.config/xsettingsd/xsettingsd.conf",
"etc/NetworkManager/dispatcher.d/30-geminux-chrony", "etc/NetworkManager/dispatcher.d/30-geminux-chrony",
"etc/polkit-1/rules.d/10-geminux.rules"): "etc/polkit-1/rules.d/10-geminux.rules"):
if not os.path.lexists(os.path.join(rootfs, req_rel)): if not os.path.lexists(os.path.join(rootfs, req_rel)):
+1
View File
@@ -183,6 +183,7 @@ xkeyboard-config
xrandr xrandr
xrdb xrdb
xset xset
xsettingsd
xsetroot xsetroot
yabasic yabasic
yt-dlp-core yt-dlp-core
+75 -3
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Verify all Geminux .xth themes and dunst theme synchronization.""" """Verify all Geminux .xth themes, dunst synchronization, and GTK2/GTK3 synchronization."""
import glob import glob
import os import os
@@ -11,6 +11,9 @@ import tempfile
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
THEMES_DIR = os.path.join(BASE_DIR, "overlay", "rootfs", "etc", "skel", ".xthemes") THEMES_DIR = os.path.join(BASE_DIR, "overlay", "rootfs", "etc", "skel", ".xthemes")
SYNC_SCRIPT = os.path.join(BASE_DIR, "overlay", "rootfs", "usr", "bin", "geminux-sync-dunst-theme") SYNC_SCRIPT = os.path.join(BASE_DIR, "overlay", "rootfs", "usr", "bin", "geminux-sync-dunst-theme")
GTK_SYNC_SCRIPT = os.path.join(BASE_DIR, "overlay", "rootfs", "usr", "bin", "geminux-sync-gtk-theme")
LIGHT_THEMES = frozenset({"CatppuccinLatte", "GruvboxLight", "SolarizedLight"})
REQUIRED_KEYS = ( REQUIRED_KEYS = (
"theme.name", "theme.fontFace", "theme.iconFontFace", "theme.baseFontSize", "theme.name", "theme.fontFace", "theme.iconFontFace", "theme.baseFontSize",
@@ -42,7 +45,7 @@ def main():
assert len(themes) >= 20, f"Expected >= 20 themes, found {len(themes)}" assert len(themes) >= 20, f"Expected >= 20 themes, found {len(themes)}"
with tempfile.TemporaryDirectory(prefix="geminux-dunst-test-") as tmp: with tempfile.TemporaryDirectory(prefix="geminux-dunst-test-") as tmp:
for th in themes: for idx, th in enumerate(themes):
vals = parse_xres(th) vals = parse_xres(th)
for req in REQUIRED_KEYS: for req in REQUIRED_KEYS:
assert req in vals and vals[req], f"Missing {req} in {os.path.basename(th)}" assert req in vals and vals[req], f"Missing {req} in {os.path.basename(th)}"
@@ -66,7 +69,76 @@ def main():
assert "font = Fira Code " in txt assert "font = Fira Code " in txt
assert "width = 720" in txt assert "width = 720" in txt
print(f"[PASS] Verified {len(themes)} .xth themes and dunst synchronization") th_home = os.path.join(tmp, f"home-{idx}")
os.makedirs(th_home, exist_ok=True)
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",
)
}
gtk_env["HOME"] = th_home
gtk_env["GEMINUX_XRESOURCES"] = th
subprocess.run([GTK_SYNC_SCRIPT, "--no-reload"], env=gtk_env, check=True)
tname = vals["theme.name"]
gtk_name = f"Geminux-{tname}"
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"):
cfg_path = os.path.join(th_home, cfg_rel)
with open(cfg_path, encoding="utf-8") as cf:
cfg_txt = cf.read()
assert gtk_name in cfg_txt, f"Missing {gtk_name} in {cfg_rel} for {tname}"
assert "/tmp" not in cfg_txt and "/home" not in cfg_txt, (
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}"
)
with open(os.path.join(th_home, ".config/xsettingsd/xsettingsd.conf"), encoding="utf-8") as xf:
xsd_txt = xf.read()
assert f'Net/ThemeName "{gtk_name}"' in xsd_txt
assert "Xft/DPI" not in xsd_txt, f"Unexpected Xft/DPI in xsettingsd.conf for {tname}"
with open(os.path.join(theme_root, "index.theme"), encoding="utf-8") as itf:
idx_txt = itf.read()
assert f"GtkTheme={gtk_name}" in idx_txt
with open(os.path.join(theme_root, "gtk-2.0/gtkrc"), encoding="utf-8") as rc2f:
rc2_txt = rc2f.read()
assert 'engine "' not in rc2_txt, f"External GTK2 engine referenced in {tname}"
for ck in ("theme.bgMain", "theme.fgMain", "theme.selBg", "theme.accent"):
assert vals[ck] in rc2_txt, f"Missing {ck} in gtkrc for {tname}"
with open(os.path.join(theme_root, "gtk-3.0/gtk.css"), encoding="utf-8") as css3f:
css3_txt = css3f.read()
exp_base = "gtk-contained.css" if is_light else "gtk-contained-dark.css"
assert f'@import url("resource:///org/gtk/libgtk/theme/Adwaita/{exp_base}");' in css3_txt, (
f"Wrong Adwaita base CSS in {tname}: expected {exp_base}"
)
assert css3_txt.count("{") == css3_txt.count("}"), f"Unbalanced braces in gtk.css for {tname}"
for ck in ("theme.bgMain", "theme.fgMain", "theme.selBg", "theme.accent", "theme.dangerBg"):
assert vals[ck] in css3_txt, f"Missing {ck} in gtk.css for {tname}"
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()
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"))
print(f"[PASS] Verified {len(themes)} .xth themes, dunst synchronization, and GTK2/GTK3 theme generation")
return 0 return 0
+2
View File
@@ -67,9 +67,11 @@ int main(int argc, char** argv) {
::setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "0", 1); ::setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "0", 1);
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "0", 1); ::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "0", 1);
::setenv("JSC_useJIT", "0", 1); ::setenv("JSC_useJIT", "0", 1);
::unsetenv("GTK_THEME");
configureWebkitRenderer(false); configureWebkitRenderer(false);
CHECK(::getenv("WEBKIT_DISABLE_DMABUF_RENDERER") == nullptr); CHECK(::getenv("WEBKIT_DISABLE_DMABUF_RENDERER") == nullptr);
CHECK(::getenv("WEBKIT_DISABLE_COMPOSITING_MODE") == nullptr); CHECK(::getenv("WEBKIT_DISABLE_COMPOSITING_MODE") == nullptr);
CHECK(::getenv("GTK_THEME") == nullptr);
CHECK(std::string(::getenv("JSC_useJIT")) == "0"); CHECK(std::string(::getenv("JSC_useJIT")) == "0");
FILE* f = std::fopen(flag.c_str(), "wb"); FILE* f = std::fopen(flag.c_str(), "wb");
+2 -2
View File
@@ -79,7 +79,7 @@ static void apply_selected(themes_state_t *st) {
const char *argv[] = {"/usr/bin/geminux-apply-theme", st->items[st->sel].name, NULL}; const char *argv[] = {"/usr/bin/geminux-apply-theme", st->items[st->sel].name, NULL};
int rc = gemui_run_cmd_capture(argv, NULL, 0); int rc = gemui_run_cmd_capture(argv, NULL, 0);
gemui_theme_reload(st->app); gemui_theme_reload(st->app);
gemui_show_toast(st->app, rc == 0 ? "Applied .Xresources + dunst theme" : "Theme apply failed", 2000); gemui_show_toast(st->app, rc == 0 ? "Applied .Xresources, GTK2/GTK3 & dunst theme" : "Theme apply failed", 2000);
gemui_request_redraw(st->app); gemui_request_redraw(st->app);
} }
@@ -146,7 +146,7 @@ static void on_draw(gemui_app_t *app, cairo_t *cr, int w, int h, void *ud) {
} }
gemui_draw_button(app, cr, (gemui_rect_t){right_x, h - 94, right_w, 74}, gemui_draw_button(app, cr, (gemui_rect_t){right_x, h - 94, right_w, 74},
"Apply Across DWM, st, dmenu, dunst & Apps", HIT_APPLY, 0, true, false, false); "Apply Across DWM, st, dmenu, dunst, GTK2/3 & Apps", HIT_APPLY, 0, true, false, false);
} }
static void on_key(gemui_app_t *app, KeySym ks, unsigned int state, const char *utf8, void *ud) { static void on_key(gemui_app_t *app, KeySym ks, unsigned int state, const char *utf8, void *ud) {
+44 -3
View File
@@ -75,7 +75,6 @@ void configureWebkitRenderer(bool software) {
::unsetenv("WEBKIT_DISABLE_COMPOSITING_MODE"); ::unsetenv("WEBKIT_DISABLE_COMPOSITING_MODE");
::unsetenv("WEBKIT_SKIA_ENABLE_CPU_RENDERING"); ::unsetenv("WEBKIT_SKIA_ENABLE_CPU_RENDERING");
::setenv("GDK_BACKEND", "x11", 1); ::setenv("GDK_BACKEND", "x11", 1);
::setenv("GTK_THEME", "Adwaita:dark", 1);
::setenv("NO_AT_BRIDGE", "1", 1); ::setenv("NO_AT_BRIDGE", "1", 1);
::setenv("GTK_A11Y", "none", 1); ::setenv("GTK_A11Y", "none", 1);
::setenv("WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS", "1", 1); ::setenv("WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS", "1", 1);
@@ -322,6 +321,7 @@ static const UaPreset kUaPresets[] = {
}; };
struct XresTheme { struct XresTheme {
std::string name = "GeminuxHelio";
std::string fontFace = "Fira Code, Noto Sans"; std::string fontFace = "Fira Code, Noto Sans";
std::string bgMain = "#0f1419"; std::string bgMain = "#0f1419";
std::string bgBar = "#0b0e14"; std::string bgBar = "#0b0e14";
@@ -370,6 +370,7 @@ XresTheme loadXresourcesTheme() {
auto it = kv.find(k); auto it = kv.find(k);
if (it != kv.end() && !it->second.empty()) dst = it->second; if (it != kv.end() && !it->second.empty()) dst = it->second;
}; };
pick("theme.name", t.name);
pick("theme.fontFace", t.fontFace); pick("theme.fontFace", t.fontFace);
pick("theme.bgMain", t.bgMain); pick("theme.bgMain", t.bgMain);
pick("theme.bgBar", t.bgBar); pick("theme.bgBar", t.bgBar);
@@ -478,14 +479,54 @@ struct BrowserApp {
bool syncingUiFlags = false; bool syncingUiFlags = false;
}; };
bool isDarkHexColor(const std::string& hex) {
if (hex.size() != 7 || hex[0] != '#') return true;
auto hexByte = [&](size_t pos, int& out) -> bool {
auto nib = [](char c) -> int {
if (c >= '0' && c <= '9') return c - '0';
if (c >= 'a' && c <= 'f') return 10 + (c - 'a');
if (c >= 'A' && c <= 'F') return 10 + (c - 'A');
return -1;
};
int hi = nib(hex[pos]);
int lo = nib(hex[pos + 1]);
if (hi < 0 || lo < 0) return false;
out = (hi << 4) | lo;
return true;
};
int r = 0, g = 0, b = 0;
if (!hexByte(1, r) || !hexByte(3, g) || !hexByte(5, b)) return true;
double lum = 0.2126 * r + 0.7152 * g + 0.0722 * b;
return lum < 128.0;
}
std::string sanitizeGtkThemeSuffix(const std::string& raw) {
std::string out;
for (unsigned char ch : raw) {
if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') ||
(ch >= '0' && ch <= '9') || ch == '.' || ch == '_' || ch == '-') {
out.push_back(static_cast<char>(ch));
}
}
return out.empty() ? "GeminuxHelio" : out;
}
void applyGtkThemeCss(BrowserApp* app) { void applyGtkThemeCss(BrowserApp* app) {
if (!app || !app->cssProvider) return; if (!app || !app->cssProvider) return;
XresTheme t = loadXresourcesTheme(); XresTheme t = loadXresourcesTheme();
std::string gtkFont = t.fontFace + ", Noto Sans 9"; std::string gtkFont = t.fontFace + ", Noto Sans 9";
bool preferDark = isDarkHexColor(t.bgMain);
std::string candidateTheme = "Geminux-" + sanitizeGtkThemeSuffix(t.name);
std::string homeThemeCss = getHomeDirPath() + "/.themes/" + candidateTheme + "/gtk-3.0/gtk.css";
std::string sysThemeCss = "/usr/share/themes/" + candidateTheme + "/gtk-3.0/gtk.css";
std::string gtkThemeName =
(::access(homeThemeCss.c_str(), R_OK) == 0 || ::access(sysThemeCss.c_str(), R_OK) == 0)
? candidateTheme
: "Adwaita";
if (GtkSettings* gs = gtk_settings_get_default()) { if (GtkSettings* gs = gtk_settings_get_default()) {
g_object_set(gs, g_object_set(gs,
"gtk-application-prefer-dark-theme", TRUE, "gtk-application-prefer-dark-theme", preferDark ? TRUE : FALSE,
"gtk-theme-name", "Adwaita:dark", "gtk-theme-name", gtkThemeName.c_str(),
"gtk-font-name", gtkFont.c_str(), "gtk-font-name", gtkFont.c_str(),
nullptr); nullptr);
} }