A Wayland desktop environment in Rust.
sash-wm: the compositor, built on Smithay.sash-ui: the first-party UI toolkit (not started yet).
Licensed under Apache-2.0. See LICENSE and NOTICE.
cargo build
cargo clippy --all-targets -- -D warnings
cargo fmt --check
cargo test
cargo test --features debug-record
cargo deny checkNested inside an existing Wayland session (for example Hyprland):
RUST_LOG=sash_wm=debug cargo run -p sash-wmsash-wm logs the name of its own Wayland socket. Start clients against it
with WAYLAND_DISPLAY=<socket> <client>.
On the hardware, from a text console (M9; only by the owner's checklist
docs/m9-stage-c.md on the real machine, with tools/stage-c.sh; tested in a VM, see
tools/vm/README.md):
sash-wm # mod is Super; Super+Shift+E quits
sash-wm --exit-after 20 # debug builds: a watchdog that quits after 20 s
sash-wm --mode 5120x1440@60 # debug builds: this mode instead of the rule
SASH_DEBUG_REJECT_MODES=5120x1440@240 sash-wm # debug builds: fail these test commits
SASH_DEBUG_REJECT_ALL_MODES=1 sash-wm # debug builds: fail every test commit
tools/stage-c.sh 20 run1 --mode 5120x1440@60 # the owner's stage C runsDebug recording for bugs on real hardware (feature debug-record, debug builds only;
see docs/DEBUG.md):
cargo build -p sash-wm --features debug-record
SASH_DEBUG_RECORD=~/.cache/sash/debug target/debug/sash-wm # mod+F11 writes a bundle
tools/replay.sh ~/.cache/sash/debug/bundle-<time> # replay it headlessThe backend is chosen from the environment: nested (winit) when WAYLAND_DISPLAY or
DISPLAY is set, DRM in a local console session (XDG_SESSION_ID, XDG_SEAT and
XDG_VTNR all set; a remote login is refused). --backend winit|drm overrides it.
The mode is the panel's native resolution at its highest refresh rate, each candidate
checked with a test commit first (rules in CLAUDE.md).
The keyboard layout follows XKB_DEFAULT_LAYOUT, XKB_DEFAULT_VARIANT,
XKB_DEFAULT_OPTIONS (and the other XKB_DEFAULT_*); nothing is read from system
configuration. tools/drm-probe.py [--all-modes] lists DRM devices, connectors,
modes and planes with queries only (no DRM master, no mode set).
Debug builds open $XDG_RUNTIME_DIR/sash-wm-input-<wayland socket>.sock (mode 0600).
Each line is one command, answered with ok or error: ...:
motion <x> <y> pointer to (x, y), output coordinates
button <left|right|middle|code> <press|release>
key <evdev code> <press|release> e.g. 56 = left Alt
Release builds contain neither this nor the capture code: tools/check-release.sh
checks the release binary (CI runs it).
SASH_CAPTURE_DIR=/tmp/shots cargo run -p sash-wm &
kill -USR1 <sash-wm pid> # writes /tmp/shots/sash-wm-capture-1.pngsash-wm renders its current output once more into an offscreen buffer and writes it as a PNG; the host screen is never read. Release builds ignore SIGUSR1.
tools/measure/: scripted measurements through the synthetic input. Build the measurement binary (optimized, debug assertions on) withsource tools/measure/common.sh && build_measure, then runtools/measure/run-drags.sh <log>(drags on three foot windows),tools/measure/run-popup.sh <log> <capture dir>(pavucontrol menu while dragging),tools/measure/run-resize.sh <log> <steps> <client...>(configure to first buffer at the new size, keyboard resizes) ortools/measure/idle.sh <log> <windows> <seconds>(idle CPU and memory, release build). Each prints frame-time and frame-interval statistics from the log.tools/similarity/: the per-milestone similarity check against Smithay's examples. In a venv withpip install copydetect==0.5.0and a clone of Smithay at tagv0.7.0:python -I tools/similarity/summary.py sash-wm/src <smithay clone> 25 30 4;tools/similarity/pair.py <sash file> <reference file> 25 30shows what matched.
- Build:
build-essential pkg-config libxkbcommon-dev libseat-dev libinput-dev libudev-dev libgbm-dev - Runtime:
libseat1 libinput10 libudev1 libgbm1 libxkbcommon0; loaded with dlopen:libwayland-client0(nested and tests),libegl1and a GL driver (Mesalibegl-mesa0 libgles2 libgl1-mesa-dri, or the NVIDIA driver)
The Rust version is pinned exactly in rust-toolchain.toml. To update:
rustup checkto see the current stable version.- Change
channelinrust-toolchain.tomlto that exact version (for example"1.100.0"). - Run the full check list above, plus the Debian trixie container build.
- Commit the toolchain change on its own, with the check output in the commit message.