9.3 KiB
9.3 KiB
ANODE architecture
Component map
Makefile&scripts/detect-env.sh: Strict.POSIX:single build orchestration probing OS headers,-lcryptvs<crypt.h>,-lrt,-lutil,XScrnSaver, and optionalgtk+-2.0/tcl/tkheaders cleanly intobuild/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 Codeligatures), vector 3-bar hamburger launcher button indwm, full-height-l 0mode indmenu,St.font+ liveXft.dpiFontconfig resolution inst,.Xresources+SIGUSR1live reload,anode_scale.h, ICCCMWM_S<screen>--replacehandoff (exit 75when yielded soanode-sessionholds the session), andANODE WMEWMH identity.src/libgemui/: Shared librarylibgemui.so+gemui.pcproviding double-buffered Cairo + Pango rendering (theme.fontFaceFira Code+theme.iconFontFaceNerd Font fallback), workarea-clamped responsive window sizing,fullscreen_overridestacking guard (VisibilityNotify/MapNotify/ConfigureNotify) keepinganode-lockabove the systray/bar while permittinganode-vkbd, hit tracking, touch-mode sizing (gemui_touch_row_px), self-pipeSIGUSR1+ rootXA_RESOURCE_MANAGERlive reload, and non-blockingpoll()loops.src/apps/: Desktop control panels and optional dock virtual keyboard (anode-vkbd) + multimedia dispatcher (anode-media-key).src/daemons/: Event-drivenpoll()+ signal self-pipe daemons (anode-statusd,anode-touchd,anode-powerdwithpower.confidle overrides) and narrowly-scoped privilege helpers (anode-power-ctl,anode-dnsctl,anode-tzctl,anode-checkpwwith/sbin/unix_chkpwdfallback).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.xththemes,data/env.shXDG/FlatpakXDG_DATA_DIRSnormalization, full-XDGanode-launcher, strict POSIX/bin/shsynchronization scripts, live session replacement (anode-replace), and i3-style session autostart management (anode-autostart+data/autostarttemplate).
Fractional DPI multi-toolkit contract
For a user or EDID-detected scale S clamped to [0.50, 4.00]:
Xft.dpi = round(96 * S)(anode-apply-scale autohonors explicitxdpyinfoserver DPI outside[94, 98]before falling back to physical XRandR EDID dimensions)ANODE_SCALE = S,theme.baseFontSize = round(15 * S), and discrete standard Xcursor sizes (16,24,32,48,64mapped from24 * S);~/.config/anode/scale.conftakes precedence over stale session environment variables during live updates, whileanode-apply-scaleanddwmpropagate updated scaling environment variables acrossX11,D-Bus, and newly spawned child processes.- GTK-2 / GTK-3 / GTK-4 / xsettingsd / Fontconfig:
Gdk/WindowScalingFactor = (S < 1.75) ? 1 : round(S),Xft/DPI = Xft.dpi * 1024, andGdk/UnscaledDPI = round(Xft/DPI / Gdk/WindowScalingFactor)inxsettingsd.confwithGDK_SCALEandGDK_DPI_SCALEkept unset (unset) so GTK-3, GTK-4, and Chromium/Electron apps scale cleanly without multiplyingXft.dpi * GDK_SCALE;ADW_DISABLE_PORTAL=1, unscaled logical non-monospace UI point sizes (theme.uiFontFace,Robotowith automaticNoto Sansfallback,round((baseFontSize / S) * 0.65), e.g.10pt), generated~/.themes/ANODE-<name>/gtk-{3.0,4.0}/gtk.cssthemes inherit GTK's built-in Adwaita/Default stylesheets viaresource:///...@import(auto-detecting dark vs light fromtheme.isDarkortheme.bgMainluminance) with color-only overrides so native widget/menu spacing and borders stay intact, color-only@define-coloroverrides in~/.config/gtk-{3.0,4.0}/gtk.css, Fontconfig$XDG_CONFIG_HOME/fontconfig/conf.d/60-anode-fonts.confaliasingsans-seriftoRoboto/Noto SansandmonospacetoFira Code,gsettingssynchronization (org.gnome.desktop.interface) when active,gtk-cursor-theme-size = Xcursor.sizefor GTK-2, andGtk/CursorThemeSize/gtk-cursor-theme-size = round(Xcursor.size / Gdk/WindowScalingFactor)forxsettingsdand GTK-3/4. - Dunst notifications:
anode-sync-dunst-themepinsscale = 1, pre-scales geometry byS, and uses pixel font sizing (Fira Code <baseFontSize>px) soXft.dpinever double-scales notifications. - User
.Xresources& terminal overrides:anode-apply-themesetsst.fonttoFira Code:size=13, preserves explicitSt.*resource lines across theme switches, and appends$XDG_CONFIG_HOME/anode/Xresources.local, whilestdefaults toFira Code:size=13, honors explicitSt.fontoverrides overst.font, and resolvessize=fonts against liveXft.dpi. - Qt5 / Qt6:
QT_QPA_PLATFORMTHEME=gtk3:qt6ct:qt5ct(Qt follows ANODE's active GTK-3 theme first, with synced palettes andgeneral=Roboto,10/fixed=Fira Code,10typography in~/.config/qt5ct/and~/.config/qt6ct/as fallback),QT_AUTO_SCREEN_SCALE_FACTOR=0,QT_ENABLE_HIGHDPI_SCALING=1,QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough,QT_SCALE_FACTOR=S, andQT_FONT_DPI=96. - Tk / Tkinter (
gtkTtk):*TkTheme: gtkTtk, Tk scaling normalized againstANODE_SCALE/Xft.dpi, usingRoboto(orNoto Sansfallback) for standard UI fonts (TkDefaultFont,TkTextFont,TkMenuFont,TkHeadingFont) andFira CodeforTkFixedFont.
First-class systray & EWMH workarea struts
In src/dwm/dwm.c:
- Acquires screen-specific
_NET_SYSTEM_TRAY_S<screen>using a 32-bit ARGBTrueColorvisual (when available, falling back cleanly to screen default visual) and publishes_NET_SYSTEM_TRAY_VISUALand_NET_SYSTEM_TRAY_ORIENTATION = 0. - Tracks XEmbed
_XEMBED_INFOflags bitdata[1](XEMBED_MAPPED), preservesSubstructureNotifyMask, emitsXEMBED_WINDOW_ACTIVATE/XEMBED_WINDOW_DEACTIVATE (2), unmaps the tray window when empty (0mapped icons), mapssystray->winviaXMapWindowconfigured directlyAbovem->barwin(neverXMapRaisedover fullscreen windows oranode-lock), undocks cleanly onReparentNotify/UnmapNotify/DestroyNotify, centers & re-scales icons onSIGUSR1/XA_RESOURCE_MANAGER, and relocates cleanly across monitors. - Monitors
_NET_WM_WINDOW_TYPE_DOCKwindows (_NET_WM_STRUT_PARTIAL/_NET_WM_STRUT), includingoverride_redirectdocks such asanode-vkbd, adjusting monitor workarea bounds (wx, wy, ww, wh) and publishing root_NET_WORKAREA.
Session autostart pipeline
anode-sessionexportsXDG_CURRENT_DESKTOP=ANODE,XDG_SESSION_DESKTOP=anode,DESKTOP_SESSION=anode, and optionalANODE_SESSION_PROFILE, seeds~/.config/anode/autostartand~/.config/anode/autostart.d/, and starts a background waiter polling_NET_SUPPORTING_WM_CHECKbefore invokinganode-autostart start.anode-autostartevaluates declarative files (autostart+ optionalautostart.<profile>+includegraph via POSIXawk), enforcing UID- andXDG_SESSION_ID/D-Bus-session-awareexec_oncefiltering, then onstartevaluatesautostart.d/drop-ins andANODE-filtered XDG.desktopentries with user-over-system basename masking.src/dwm/dwm.ctriggersanode-autostart reload(running onlyexec_always) from interactivereloadxres(Mod4 + Shift + r,arg->i = 1) and post-SIGHUPexecvprestart (ANODE_DWM_RESTARTED=1), whileSIGUSR1andXA_RESOURCE_MANAGERpassNULLso live theme/DPI reloads never cause autostart loops.
Live replacement, desktop identity & status telemetry
- ICCCM
WM_S<screen>takeover & fallback:src/dwm/dwm.c(acquirewm,--replace) claimsWM_S<screen>onwmcheckwin, broadcastsMANAGER, exits cleanly with status75onSelectionClear(soanode-sessionkeeps the session alive while monitoring the new WM), and waits up to 5 s forprev_ownerdestruction andSubstructureRedirectMask.scripts/anode-replacepairs this with a 1.5 s UID-checked_NET_WM_PID(or UID-filtered_NET_WM_NAME)SIGTERMfallback for non-ICCCM WMs,--switch-sessionone-shot~/.xprofilehandoff for active LightDM sessions, and DM session-leader safety checks. - EWMH/XDG desktop identity:
dwmpublishes_NET_WM_NAME = "ANODE WM",XA_WM_NAME = "ANODE WM", and_NET_WM_PID, whileanode-sessionandanode-replaceclear stale foreign DE variables, exportXDG_CURRENT_DESKTOP=ANODE, and update DBus/systemd user activation environments so system tools such asfastfetchreportDesktop Environment: ANODEandWindow Manager: ANODE WM (X11). - Event-driven status & XKB layout indicator:
src/daemons/anode-statusd.cselectsXkbNewKeyboardNotifyMask | XkbMapNotifyMask | XkbNamesNotifyMaskandXkbGroupStateMask-filteredXkbStateNotifyevents on the X11 fd, resolving lowercase layout codes viasrc/common/anode_xkb_parse.h(live XKB symbols ->_XKB_RULES_NAMES-> group names) and reading cross-Unix CPU/RAM telemetry (src/common/anode_sys_parse.h/src/common/anode_plat.c) on a<= 2000 mspoll()refresh cadence (without busy-polling) to publishVOL | CPU | RAM | BAT/AC | <xkb> | YYYY-MM-DD HH:MM.