Expand description
Session-aware Linux startup splash.
The launcher is up in milliseconds; agentmux-cef is the multi-second cold
start (CEF init + GPU channel + page load). This paints a pulsing brain logo
over a dark backdrop in that gap β the Linux analogue of splash.rs (Win32)
and splash_mac.rs (Cocoa).
The backend is chosen for centering fidelity, not to mirror the hostβs
ozone choice: the X11 backend draws an override_redirect window it positions
itself (centered on the primary monitor) and XWayland honors that, so it
centers under both X11 and native-Wayland sessions. A native-Wayland
xdg_toplevel, by contrast, cannot self-position β Mutter drops small
toplevels at the top-left, not centered. XWayland is present in nearly every
Wayland session, so we prefer the X11 backend whenever an X server is reachable
and fall back to the Wayland backend only when there is no X display at all.
Dismiss protocol is the macOS one: spawn() sets AGENTMUX_SPLASH_READY_FILE
(the host inherits it and writes the file on first paint); the splash thread
polls for that file and tears down, with a safety timeout for a host that
crashes before painting.
Spec: docs/specs/SPEC_LINUX_SPLASH_SESSION_AWARE_2026_06_20.md
ModulesΒ§
- wayland π
- Wayland splash backend β a software-drawn (
wl_shm)xdg_toplevelshowing the pulsing brain. This is the fallback path, used only when no X server is reachable (super::detectprefers the self-centering X11/XWayland backend whenever XWayland is up β see that moduleβs doc for why). - x11 π
- X11 splash backend β a software-drawn, override-redirect window showing the pulsing brain over a dark backdrop, dismissed (with a fade-out) when the host writes the ready-file or after the safety timeout. For X11 / XWayland sessions.
StructsΒ§
- Stage
List π - Accumulates startup events and emits rendered text lines for the stage band.
EnumsΒ§
- Session π
ConstantsΒ§
- BG_B π
- BG_G π
- BG_R π
- Opaque dark backdrop RGB(26, 26, 31) = #1A1A1F.
- BORDER_
B π - BORDER_
G π - BORDER_
R π - BORDER_
WIDTH_ πPX - BRAIN_H
- BRAIN_W
- CARD_H π
- CARD_W π
- Full card dimensions: brain + padding, stage band, footer band.
- CORNER_
RADIUS_ πPX - Rounded-corner radius for the backdrop (px). Matches splash_mac.rs.
- DISMISS_
TIMEOUT π - Self-dismiss if the host never signals first paint (crash before frame).
- FADE_
IN_ πS - FADE_
OUT π - Opacity fade-out duration on dismiss. Matches splash_mac.rs.
- FOOTER_
COLOR π - Muted footer text color (#8A8A93) on the #1A1A1F backdrop.
- FOOTER_
H π - Bottom band height: top pad + 2 glyph rows + inter-line gap + bottom pad.
- FOOTER_
LINE_ πGAP - FOOTER_
PAD_ πBOTTOM - FOOTER_
PAD_ πTOP - FRAME_
MS π - ~60 fps animation tick.
- PADDING π
- Backdrop padding around the brain, in px.
- PULSE_
HZ π - PULSE_
MAX π - PULSE_
MIN π - STAGE_
COLOR π - Muted stage text color β slightly brighter than the footer for readability.
- STAGE_H π
- Height of the stage band.
- STAGE_
LINE_ πGAP - Vertical gap between stage lines.
- STAGE_
MAX_ πLINES - Maximum number of stage lines shown simultaneously.
- STAGE_
PAD_ πTOP - Vertical padding above the first stage line.
- STAGE_X π
- Left margin for stage lines (px from card edge).
StaticsΒ§
- BRAIN_
RGBA π - Brain logo as straight (non-pre-multiplied) RGBA8, emitted by build.rs.
FunctionsΒ§
- corner_
coverage π - Rounded-rect coverage (0..=1) at pixel (x, y) for a
wΓhrect with cornerradius(0 = square), anti-aliased over a 1-px band on the corner arcs. - detect π
- Pick the splash backend by centering ability. The X11 backend self-centers (override-redirect, positioned on the RANDR primary) and XWayland honors that, so prefer it whenever an X server is actually reachable β including under a native-Wayland session, where the Wayland backend canβt self-center and Mutter drops the splash top-left. Only with no usable X display do we fall back to the best-effort Wayland backend.
- fade_
alpha π - Global fade-out opacity in 0..=1. Returns 1.0 until
fade_startis set, then ramps linearly to 0.0 overFADE_OUT. Shared by both backends. - min_
hold π - Minimum on-screen time before the splash is allowed to dismiss, so a fast
cold start canβt produce a sub-perceptible flash (worse than no splash).
Overridable via
AGENTMUX_SPLASH_HOLD_MSβ also handy for eyeballing the splash during testing (e.g.AGENTMUX_SPLASH_HOLD_MS=3000). - pulse_
alpha π - Pulse alpha in 0..=1 for elapsed seconds since the splash appeared: a linear
ramp 0β1 over
FADE_IN_S, then aPULSE_HZsine betweenPULSE_MIN..PULSE_MAX(the backdrop stays opaque; only the brainβs alpha breathes). Shared by both backends. - render_
frame π - Composite one frame, pre-multiplied, into a 4-byte-per-pixel buffer: the
dark backdrop with the centered brain blended at
brain_alpha, the stage list band, and the footer identity strip β all masked to aradius-rounded rect and scaled by the globalwindow_alpha(fade-out). Pre-multiplied output is what both X Render compositors andwl_shmARGB8888 expect.bgrselects byte order:trueβ B,G,R,A (X11 ARGB / Wayland ARGB8888 on LE),falseβ R,G,B,A. Shared by both backends. - spawn
- Spawn the startup splash. Sets
AGENTMUX_SPLASH_READY_FILE(inherited by the host, which writes it on first paint) and runs the matching backend on a dedicated thread, so the launcherβs main thread continues to start srv + host. The thread self-terminates on first-paint or the safety timeout. Best-effort: any failure (no display, protocol error) just means no splash β the launcher is unaffected.