5.2 KiB
5.2 KiB
ANODE session management & status bar
Starting or live-replacing an X11 session
- Fresh X11 startup: Launch ANODE from
~/.xinitrc(exec /usr/local/bin/anode-session [--profile NAME]) or select the installedANODEsession (PREFIX/share/xsessions/anode.desktop) in a display manager.anode-sessionalso accepts--replaceand--no-autostartand forwards--replacetodwm --replace. - Live replacement (
anode-replace): Replace an active X11 window manager or desktop session without logging out or closing open X11 windows:
anode-replace --dry-run
anode-replace
anode-replace --profile work --keep-panels
| Flag | Behavior |
|---|---|
--profile NAME / --profile=NAME |
Pass session autostart profile NAME (ANODE_SESSION_PROFILE) to anode-session |
--keep-panels |
Keep existing third-party panels, notification daemons, and settings daemons running |
--foreground |
Exec anode-session --replace in the foreground instead of detaching |
--no-autostart |
Skip anode-autostart start during replacement |
--dry-run |
Print the detected WM (_NET_SUPPORTING_WM_CHECK window and PID), cleanup mode, and command without replacing |
-h, --help |
Print command usage and exit |
- Two-stage WM handoff:
- ICCCM 2.0
WM_S<screen>takeover:dwmclaimsWM_S<screen>on its check window and handlesSelectionClearby cleanly unwinding (restart_dwm = 0; running = 0;). When invoked with--replace,dwmacquiresWM_S<screen>, broadcasts a rootMANAGERClientMessage, and pollsConnectionNumber(dpy)for up to 5 s until the previous owner destroys its selection window and releasesSubstructureRedirectMask. - Non-ICCCM fallback: Before launching
anode-session --replace,anode-replacerecords_NET_WM_PIDfrom_NET_SUPPORTING_WM_CHECK. If the previous window manager still holds_NET_SUPPORTING_WM_CHECKafter 1.5 s and its PID belongs to the current UID (checked via POSIXps),anode-replacesendsSIGTERMsodwm --replacecan take overSubstructureRedirectMask.
- ICCCM 2.0
- Process cleanup & detached readiness:
anode-replaceterminates duplicate UID-owned ANODE daemons (anode-statusd,anode-powerd,anode-touchd,anode-vkbd) and, unless--keep-panelsis given, stops conflicting third-party panels, notification daemons, and settings daemons (xfce4-panel,mate-panel,lxpanel,tint2,polybar,lemonbar,fbpanel,plank,wingpanel,dunst,xfce4-notifyd,xsettingsd,xfsettingsd). By default it launchesanode-session --replaceimmune toSIGHUPand waits up to 5 s forANODE WMto advertise itself on_NET_SUPPORTING_WM_CHECK.
Desktop environment & window manager identity
- EWMH & ICCCM properties:
dwmsets_NET_WM_NAME = "ANODE WM",XA_WM_NAME = "ANODE WM",_NET_SUPPORTING_WM_CHECK, and_NET_WM_PIDonwmcheckwin, and sets{"anode-wm", "ANODE"}as theXClassHinton status bar windows. - Clean session environment: Both
anode-sessionandanode-replaceunset 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), exportXDG_CURRENT_DESKTOP=ANODE,XDG_SESSION_DESKTOP=anode,DESKTOP_SESSION=anode, andXDG_SESSION_TYPE=x11, and sync DBus/systemd user activation environments when available (unlessANODE_NO_DBUS=1). - System info reporting: Tools such as
fastfetchreportDesktop Environment: ANODEandWindow Manager: ANODE WM (X11)instead ofdwm. Terminals that were already open before runninganode-replacekeep their earlier shell environment until a new terminal is launched orexport XDG_CURRENT_DESKTOP=ANODEis run.
Status bar & XKB layout indicator
- Format:
anode-statusdpublishesVOL <n%> | <net> | <bat/AC> | <xkb> | YYYY-MM-DD HH:MM(plusVOL MUTEwhen muted) to the X11 rootWM_NAME. TheVOLsegment is omitted when no audio backend is detected, and<xkb>is omitted cleanly if XKB is unavailable. - Text-only layout indicator:
<xkb>is a plain lowercase ASCII layout code (for exampleus,de,ru,ua,latam,jp) positioned immediately to the left of the datetime with no prefix labels, icons, or graphics. - Zero-poll event model: After
XkbQueryExtension(),anode-statusdsubscribes toXkbNewKeyboardNotifyMask | XkbMapNotifyMask | XkbNamesNotifyMask(XkbSelectEvents) andXkbStateNotifyfiltered solely toXkbGroupStateMask(XkbSelectEventDetails) so regular keystrokes and modifier presses never wake thepoll()loop. - Layout code resolution (
src/common/anode_xkb_parse.h):- Parse the live XKB symbols name (
XkbSymbolsNameMask), handlingsetxkbmapandxkbcompkeymaps while stripping:Ngroup selectors,(variant)suffixes, vendor prefixes (such asnec_vndr/jp->jp), and non-layout components (pc,evdev,inet,group,level3, etc.). - Fall back to the root
_XKB_RULES_NAMESlayouts CSV when the symbols string cannot be matched. - Fall back to the first two lowercase ASCII letters of the active XKB group name (
XkbGroupNamesMask).
- Parse the live XKB symbols name (