feat(theme,display,wm,power,make): add Anodized theme, editors, multi-monitor arrangement, power timeouts, bar compaction, and replace state preservation

- Replace deprecated AnodeDefault with dark-silvery Anodized default theme
- Add interactive theme editor, duplicator, and non-standard .xth importer to anode-themes (+ CLI --install)
- Fix multi-monitor dwm/lock/vkbd/EDID edge cases and integrate monitor arrangement + 15s revert into anode-display and anode-apply-display
- Gate anode-touchd behind WITH_TOUCHD=1 (keeping anode-vkbd unconditional) and add help/rebuild/install-touch/install-system targets to Makefile
- Add idle screen dim, lock, suspend, and suspend-on-AC timeout controls to anode-power and anode-display backed by power.conf + SIGUSR1
- Prevent lockscreen subtitle overflow and progressively compact status bar segments so focused window titles remain visible
- Preserve workspaces, active desktop, monitor state, floating/fullscreen states, and focus across anode-replace and restarts
This commit is contained in:
Luxferre committed 2026-11-27 08:31:35 +02:00
1 parent bb81541b42
commit 4ec3f59e02
40 files changed
+5843 -768

No files matched your search

+6 -6
View File
@@ -3,13 +3,13 @@
## Component map
- `Makefile` & `scripts/detect-env.sh`: Strict `.POSIX:` single build orchestration probing OS headers, `-lcrypt` vs `<crypt.h>`, `-lrt`, `-lutil`, `XScrnSaver`, and optional `gtk+-2.0`/`tcl`/`tk` headers cleanly into `build/flags.sh`.
- `src/common/`: Cross-Unix platform layer (`anode_plat.c`, `anode_plat.h`), `.Xresources` / EDID fractional scale helpers (`anode_scale.h`), CPU/memory parsers (`anode_sys_parse.h`), input validators (`anode_dns_valid.h`, `anode_tz_valid.h`), XKB layout parser (`anode_xkb_parse.h`), CLI output parsers (`anode_audio_parse.h`, `anode_wifi_list.h`, `anode_bt_list.h`), and power policy (`anode_power_policy.h`).
- `src/dwm/`, `src/dmenu/`, `src/st/`: Patched suckless X11 core using Pango/HarfBuzz (`Fira Code` ligatures), vector 3-bar hamburger launcher button in `dwm`, full-height `-l 0` mode in `dmenu`, `St.font` + live `Xft.dpi` Fontconfig resolution in `st`, `.Xresources` + `SIGUSR1` live reload, `anode_scale.h`, ICCCM `WM_S<screen>` `--replace` handoff (`exit 75` when yielded so `anode-session` holds the session), and `ANODE WM` EWMH identity.
- `src/libgemui/`: Shared library `libgemui.so` + `gemui.pc` providing double-buffered Cairo + Pango rendering (`theme.fontFace` `Fira Code` + `theme.iconFontFace` Nerd Font fallback), workarea-clamped responsive window sizing, `fullscreen_override` stacking guard (`VisibilityNotify`/`MapNotify`/`ConfigureNotify`) keeping `anode-lock` above the systray/bar while permitting `anode-vkbd`, hit tracking, touch-mode sizing (`gemui_touch_row_px`), self-pipe `SIGUSR1` + root `XA_RESOURCE_MANAGER` live reload, and non-blocking `poll()` loops.
- `src/apps/`: Desktop control panels and optional dock virtual keyboard (`anode-vkbd`) + multimedia dispatcher (`anode-media-key`).
- `src/daemons/`: Event-driven `poll()` + signal self-pipe daemons (`anode-statusd`, `anode-touchd`, `anode-powerd` with `power.conf` idle overrides) and narrowly-scoped privilege helpers (`anode-power-ctl`, `anode-dnsctl`, `anode-tzctl`, `anode-checkpw` with `/sbin/unix_chkpwd` fallback).
- `src/common/`: Cross-Unix platform layer (`anode_plat.c`, `anode_plat.h`), `.Xresources` / EDID fractional scale helpers (`anode_scale.h`), unified `.xth` theme parser/editor model (`anode_xth.h`), multi-monitor arrangement/profile helpers (`anode_display_cfg.h`), CPU/memory parsers (`anode_sys_parse.h`), input validators (`anode_dns_valid.h`, `anode_tz_valid.h`), XKB layout parser (`anode_xkb_parse.h`), CLI output parsers (`anode_audio_parse.h`, `anode_wifi_list.h`, `anode_bt_list.h`), and power policy (`anode_power_policy.h`).
- `src/dwm/`, `src/dmenu/`, `src/st/`: Patched suckless X11 core using Pango/HarfBuzz (`Fira Code` ligatures), dark-silvery `Anodized` compile-time fallback palette, vector 3-bar hamburger launcher button in `dwm`, XRandR + Xinerama primary-first monitor ordering and unplug client rescue in `dwm`, full-height `-l 0` mode in `dmenu`, `St.font` + live `Xft.dpi` Fontconfig resolution in `st`, `.Xresources` + `SIGUSR1` live reload, `anode_scale.h`, ICCCM `WM_S<screen>` `--replace` handoff (`exit 75` when yielded so `anode-session` holds the session), and `ANODE WM` EWMH identity.
- `src/libgemui/`: Shared library `libgemui.so` + `gemui.pc` providing double-buffered Cairo + Pango rendering (`theme.fontFace` `Fira Code` + `theme.iconFontFace` Nerd Font fallback), automatic luminance-aware dark/light button text contrast, workarea-clamped responsive window sizing, full virtual-root spanning + primary monitor alignment (`gemui_primary_monitor_rect`) + RandR resize tracking and stacking guard (`VisibilityNotify`/`MapNotify`/`ConfigureNotify`) keeping `anode-lock` over all displays while permitting `anode-vkbd`, X11 clipboard paste (`gemui_clipboard_get`), hit tracking, touch-mode sizing (`gemui_touch_row_px`), self-pipe `SIGUSR1` + root `XA_RESOURCE_MANAGER` live reload, and non-blocking `poll()` loops.
- `src/apps/`: Desktop control panels (including the integrated `anode-themes` editor/`.xth` importer and `anode-display` multi-monitor 2D arrangement canvas with 15 s revert), monitor-scoped dock virtual keyboard (`anode-vkbd`), and multimedia dispatcher (`anode-media-key`).
- `src/daemons/`: Event-driven `poll()` + signal self-pipe daemons (`anode-statusd`, `anode-powerd` with `power.conf` idle overrides, plus opt-in `anode-touchd` built/installed only when `WITH_TOUCHD=1`) and narrowly-scoped privilege helpers (`anode-power-ctl`, `anode-dnsctl`, `anode-tzctl`, `anode-checkpw` with `/sbin/unix_chkpwd` fallback).
- `src/gtkTtk/`: Tk/Ttk native GTK-2 bridge (`libgtkTtk0.9.so` + `gtkTtk.tcl`) supporting full `[0.5, 4.0]` fractional scaling.
- `data/` & `scripts/`: 22 96-DPI `.xth` themes, `data/env.sh` XDG/Flatpak `XDG_DATA_DIRS` normalization, full-XDG `anode-launcher`, strict POSIX `/bin/sh` synchronization scripts, live session replacement (`anode-replace`), and i3-style session autostart management (`anode-autostart` + `data/autostart` template).
- `data/` & `scripts/`: 22 96-DPI `.xth` themes (defaulting to dark-silvery `Anodized.xth`, with deprecated `AnodeDefault` seamlessly falling back to `Anodized`), `data/env.sh` XDG/Flatpak `XDG_DATA_DIRS` normalization, full-XDG `anode-launcher`, strict POSIX `/bin/sh` synchronization scripts (including `anode-apply-display` for saved `$XDG_CONFIG_HOME/anode/displays.conf` layouts), live session replacement (`anode-replace`), and i3-style session autostart management (`anode-autostart` + `data/autostart` template).
## Fractional DPI multi-toolkit contract
+4 -2
View File
@@ -34,9 +34,9 @@ Default `MODKEY` is `Mod4` (`Super` / `Win`).
| `Mod4 + c` / `XF86Tools` / `XF86PowerDown` | Control center & power (`anode-power`) |
| `Mod4 + n` / `XF86WLAN` | Network, Wi-Fi, Bluetooth & DNS (`anode-net`) |
| `Mod4 + a` / `XF86Option` | Audio mixer & profiles (`anode-audio`) |
| `Mod4 + d` | Display, XRandR & fractional scaling (`anode-display`) |
| `Mod4 + d` | Monitor arrangement, XRandR & fractional scaling (`anode-display`; `--arrange` opens Arrangement directly) |
| `Mod4 + w` | Date & timezone (`anode-datetime`) |
| `Mod4 + t` | Themes & typography (`anode-themes`) |
| `Mod4 + t` | Theme selector, editor & `.xth` importer (`anode-themes`) |
| `Mod4 + v` / `XF86Keyboard` | Toggle virtual keyboard (`anode-vkbd`) |
| `Mod4 + Shift + l` / `XF86ScreenSaver` | Lock screen (`anode-lock`) |
| `Print` / `Shift+Print` / `Ctrl+Print` | Root / focused window screenshot (`anode-media-key`) |
@@ -49,6 +49,8 @@ Default `MODKEY` is `Mod4` (`Super` / `Win`).
## Edge touch gestures (`anode-touchd`)
Requires installing with `WITH_TOUCHD=1` (`make WITH_TOUCHD=1 && sudo make WITH_TOUCHD=1 install`).
| Swipe gesture | Action |
|---|---|
| Top edge swipe down | Launch `anode-launcher` |
+5 -5
View File
@@ -28,17 +28,17 @@ anode-replace --profile work --keep-panels
- **Two-stage WM handoff**:
1. **ICCCM 2.0 `WM_S<screen>` takeover**: `dwm` claims `WM_S<screen>` on its check window and handles `SelectionClear` by cleanly unwinding (`replaced_by_other = 1; restart_dwm = 0; running = 0;`). When invoked with `--replace`, `dwm` acquires `WM_S<screen>`, broadcasts a root `MANAGER` `ClientMessage`, and polls `ConnectionNumber(dpy)` for up to 5 s until the previous owner destroys its selection window and releases `SubstructureRedirectMask`.
2. **Non-ICCCM fallback**: Before launching `anode-session --replace`, `anode-replace` records `_NET_WM_PID` (or UID-matched WM PID fallback) from `_NET_SUPPORTING_WM_CHECK`. If the previous window manager still holds `_NET_SUPPORTING_WM_CHECK` after 1.5 s and its PID belongs to the current UID (checked via POSIX `ps`), `anode-replace` sends `SIGTERM` so `dwm --replace` can take over `SubstructureRedirectMask`.
- **Process cleanup & detached readiness**: `anode-replace` terminates duplicate UID-owned ANODE daemons (`anode-statusd`, `anode-powerd`, `anode-touchd`, `anode-vkbd`) and, unless `--keep-panels` is given, stops conflicting third-party panels, notification daemons, and settings daemons (`xfce4-panel`, `mate-panel`, `lxpanel`, `i3bar`, `tint2`, `polybar`, `lemonbar`, `fbpanel`, `plank`, `wingpanel`, `dunst`, `xfce4-notifyd`, `xsettingsd`, `xfsettingsd`). By default it launches `anode-session --replace` immune to `SIGHUP` and waits up to 5 s for `ANODE WM` to advertise itself on `_NET_SUPPORTING_WM_CHECK`.
- **Process cleanup & detached readiness**: `anode-replace` terminates duplicate UID-owned ANODE daemons (`anode-statusd`, `anode-powerd`, `anode-touchd`, `anode-vkbd`) and, unless `--keep-panels` is given, stops conflicting third-party panels, notification daemons, and settings daemons (`xfce4-panel`, `mate-panel`, `lxpanel`, `i3bar`, `tint2`, `polybar`, `lemonbar`, `fbpanel`, `plank`, `wingpanel`, `dunst`, `xfce4-notifyd`, `xsettingsd`, `xfsettingsd`). By default it launches `anode-session --replace` immune to `SIGHUP` and waits up to 5 s for `ANODE WM` to advertise itself on `_NET_SUPPORTING_WM_CHECK`. `anode-touchd` is opt-in at build/install time (`WITH_TOUCHD=1`) and can also be skipped per session with `ANODE_NO_TOUCHD=1`.
## Desktop environment & window manager identity
- **EWMH & ICCCM properties**: `dwm` sets `_NET_WM_NAME = "ANODE WM"`, `XA_WM_NAME = "ANODE WM"`, `_NET_SUPPORTING_WM_CHECK`, and `_NET_WM_PID` on `wmcheckwin`, and sets `{"anode-wm", "ANODE"}` as the `XClassHint` on status bar windows.
- **Clean session environment**: Both `anode-session` and `anode-replace` unset stale third-party DE variables (`KDE_FULL_SESSION`, `KDE_SESSION_VERSION`, `KDE_SESSION_UID`, `GNOME_DESKTOP_SESSION_ID`, `MATE_DESKTOP_SESSION_ID`, `CINNAMON_VERSION`, `XFCE_SESSION`, `LXQT_SESSION_CONFIG`, `TDE_FULL_SESSION`, `HYPRLAND_INSTANCE_SIGNATURE`, `SWAYSOCK`, `I3SOCK`, `BSPWM_SOCKET`, `WINDOWMAKER`, `E_START`, `GDMSESSION`) as well as stale foreign `GTK_THEME` overrides unless `ANODE_KEEP_GTK_THEME=1`, export `XDG_CURRENT_DESKTOP=ANODE`, `XDG_SESSION_DESKTOP=anode`, `DESKTOP_SESSION=anode`, and `XDG_SESSION_TYPE=x11`, sync DE identity and `QT_QPA_PLATFORMTHEME=gtk3:qt6ct:qt5ct` to DBus/systemd user activation environments when available (unless `ANODE_NO_DBUS=1`), and `anode-session` refreshes generated GTK/Qt/Fontconfig/Dunst theme files via `anode-sync-gtk-theme` and `anode-sync-dunst-theme` on startup even when `~/.Xresources` already exists.
- **EWMH & ICCCM properties**: `dwm` sets `_NET_WM_NAME = "ANODE WM"`, `XA_WM_NAME = "ANODE WM"`, `_NET_SUPPORTING_WM_CHECK`, `_NET_WM_PID` on `wmcheckwin`, maintains workspace EWMH properties (`_NET_NUMBER_OF_DESKTOPS`, `_NET_CURRENT_DESKTOP`, `_NET_DESKTOP_NAMES`, `_NET_WM_DESKTOP`), and sets `{"anode-wm", "ANODE"}` as the `XClassHint` on status bar windows. Across `anode-replace` and in-place restarts, `dwm` snapshots and restores per-window workspaces, monitor assignments, floating/fullscreen states, monitor layouts, and focus for both ANODE sessions and third-party EWMH window managers.
- **Clean session environment**: Both `anode-session` and `anode-replace` unset stale third-party DE variables (`KDE_FULL_SESSION`, `KDE_SESSION_VERSION`, `KDE_SESSION_UID`, `GNOME_DESKTOP_SESSION_ID`, `MATE_DESKTOP_SESSION_ID`, `CINNAMON_VERSION`, `XFCE_SESSION`, `LXQT_SESSION_CONFIG`, `TDE_FULL_SESSION`, `HYPRLAND_INSTANCE_SIGNATURE`, `SWAYSOCK`, `I3SOCK`, `BSPWM_SOCKET`, `WINDOWMAKER`, `E_START`, `GDMSESSION`) as well as stale foreign `GTK_THEME` overrides unless `ANODE_KEEP_GTK_THEME=1`, export `XDG_CURRENT_DESKTOP=ANODE`, `XDG_SESSION_DESKTOP=anode`, `DESKTOP_SESSION=anode`, and `XDG_SESSION_TYPE=x11`, apply any saved per-output arrangement from `$XDG_CONFIG_HOME/anode/displays.conf` via `anode-apply-display`, sync DE identity and `QT_QPA_PLATFORMTHEME=gtk3:qt6ct:qt5ct` to DBus/systemd user activation environments when available (unless `ANODE_NO_DBUS=1`), and `anode-session` refreshes generated GTK/Qt/Fontconfig/Dunst theme files via `anode-sync-gtk-theme` and `anode-sync-dunst-theme` on startup (defaulting new installs to `Anodized`, with a deprecation fallback from removed `AnodeDefault`).
- **System info reporting**: Tools such as `fastfetch` report `Desktop Environment: ANODE` and `Window Manager: ANODE WM (X11)` instead of `dwm`. Terminals that were already open before running `anode-replace` keep their earlier shell environment until a new terminal is launched or `export XDG_CURRENT_DESKTOP=ANODE` is run.
## Status bar & XKB layout indicator
- **Format**: `anode-statusd` publishes `VOL <n%> | CPU <c%> | RAM <r%> | <bat/AC> | <xkb> | YYYY-MM-DD HH:MM` (plus `VOL MUTE` when muted) to the X11 root `WM_NAME`. The `VOL` segment is omitted when no audio backend is detected, `CPU`/`RAM` use cross-Unix kernel telemetry (`/proc/stat` + `/proc/meminfo` on Linux, `sysctl` on FreeBSD/OpenBSD/NetBSD), and `<xkb>` is omitted cleanly if XKB is unavailable.
- **Format**: `anode-statusd` publishes `VOL <n%> | CPU <c%> | RAM <r%> | <bat/AC> | <xkb> | YYYY-MM-DD HH:MM` (plus `VOL MUTE` when muted) to the X11 root `WM_NAME`. The `VOL` segment is omitted when no audio backend is detected, `CPU`/`RAM` use cross-Unix kernel telemetry (`/proc/stat` + `/meminfo` on Linux, `sysctl` on FreeBSD/OpenBSD/NetBSD), and `<xkb>` is omitted cleanly if XKB is unavailable. When a narrow screen or busy systray constrains the top bar, `dwm` progressively compacts status segments (`src/common/anode_bar_fmt.h`) so the focused window title stays readable.
- **Text-only layout indicator**: `<xkb>` is a plain lowercase ASCII layout code (for example `us`, `de`, `ru`, `ua`, `latam`, `jp`) positioned immediately to the left of the datetime with no prefix labels, icons, or graphics.
- **Event-driven status loop**: After `XkbQueryExtension()`, `anode-statusd` subscribes to `XkbNewKeyboardNotifyMask | XkbMapNotifyMask | XkbNamesNotifyMask` (`XkbSelectEvents`) and `XkbStateNotify` filtered solely to `XkbGroupStateMask` (`XkbSelectEventDetails`) so regular keystrokes and modifier presses never wake the loop, pairing XKB/signal events with a `<= 2000 ms` `poll()` refresh cadence for CPU/RAM telemetry and minute-aligned clock ticks without busy-polling.
- **Layout code resolution (`src/common/anode_xkb_parse.h`)**:
@@ -55,6 +55,6 @@ anode-replace --profile work --keep-panels
## Idle power policy & screen locking
- **Idle policy (`src/daemons/anode-powerd.c` & `src/common/anode_power_policy.h`)**: Defaults to `5 min` dim (`DIM_SEC=300`, dimming to `max(0.35, 45%)` of current brightness and polling every `500 ms` while dimmed for responsive wake), `10 min` lock (`LOCK_SEC=600`), `30 min` battery-only suspend (`SUSPEND_SEC=1800`, `SUSPEND_ON_AC=0`), and `5%` critical-battery warning/suspend (`CRIT_BATT_PCT=5`), configurable in `$XDG_CONFIG_HOME/anode/power.conf`.
- **Idle policy (`src/daemons/anode-powerd.c` & `src/common/anode_power_policy.h`)**: Defaults to `5 min` dim (`DIM_SEC=300`, dimming to `max(0.35, 45%)` of current brightness and polling every `500 ms` while dimmed for responsive wake), `10 min` lock (`LOCK_SEC=600`), `30 min` battery-only suspend (`SUSPEND_SEC=1800`, `SUSPEND_ON_AC=0`), and `5%` critical-battery warning/suspend (`CRIT_BATT_PCT=5`), configurable live from either `anode-power` or `anode-display` (and in `$XDG_CONFIG_HOME/anode/power.conf`, reloaded automatically by `anode-powerd` via `SIGUSR1`).
- **Brightness restoration & backlight access**: Automatically restores saved brightness when waking from `ANODE_PWR_DIMMED` / `ANODE_PWR_LOCKED` / `ANODE_PWR_SUSPENDED` or on daemon exit. On Linux, `anode_backlight_get()` (`src/common/anode_plat.c`) verifies writable `/sys/class/backlight/*/brightness` (`access(..., W_OK) == 0`) before using sysfs, falling back to `brightnessctl` / `xrandr` when unprivileged.
- **Screen-lock authentication & stacking (`src/daemons/anode-checkpw.c`, `src/apps/anode-lock.c`)**: Verifies against `/etc/shadow` / BSD `getpwnam` directly when permitted and falls back to the setuid PAM helper (`/sbin/unix_chkpwd` / `/usr/sbin/unix_chkpwd` / `/usr/libexec/unix_chkpwd`) when running non-root; `make install` applies `chmod 4755` to `anode-checkpw` when invoked as `root` with an empty `DESTDIR`. `anode-lock` (`fullscreen_override`) stays visually stacked above `dwm`'s systray (`systray->win` configured `Above` `m->barwin`) and status bar while still allowing `anode-vkbd` on top when toggled.