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

+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.