4.4 KiB
tile-manager
A Rust Wayland tiling compositor project, built in small stages.
The target is a simple desktop tile manager in the same general space as Hyprland or niri, but with a much narrower first scope:
- nested compositor first
- one output first
- one workspace first
- one tiling layout first
This project should grow in the same order a Codecrafters-style guide would teach it: build the minimum working compositor, then add input, tiling, workspaces, multi-output, and finally standalone session support and polish.
Scope
This is not an X11 window manager.
It is intended to become a Wayland compositor that can:
- accept Wayland clients
- track windows, focus, outputs, and workspaces
- process keyboard and pointer input
- render surfaces
- apply a tiling layout
Planned Stack
Primary Rust crates:
smithay: Wayland compositor foundationcalloop: event loopxkbcommon: keyboard layout and modifierstracing: structured loggingtracing-subscriber: log output/filteringanyhow: application-level error handlingthiserror: typed internal errorsbitflags: internal state flags
Likely later additions:
serde+toml: config loadingclap: CLI flagszbus: desktop integration- XWayland-related Smithay features: X11 app support
Development Order
Stage 0: Nested compositor
Start inside an existing desktop session before touching DRM/KMS.
Goal:
- boot the compositor
- open a Wayland client
- confirm logs and state changes
Stage 1: Event loop and Wayland server
Implement:
- logging setup
calloop::EventLoop- Wayland display state
- core Smithay globals
Deliverable:
- the process starts and stays alive cleanly
Stage 2: XDG toplevel support
Implement:
- compositor state
- shared memory support
- XDG shell support
- seat support
Deliverable:
- a client can create a toplevel surface
Stage 3: Internal state model
Add plain Rust types for:
- compositor state
- outputs
- seats
- workspaces
- windows
- tile layout state
Deliverable:
- stable state snapshots after every map/unmap/focus/layout event
Stage 4: Render one output
Implement:
- one output
- solid background
- mapped surface rendering
- frame presentation
Deliverable:
- one client is visible on screen
Stage 5: Input and bindings
Implement:
- keyboard input
- pointer input
- compositor modifier handling
- a few core commands
Minimum commands:
- spawn terminal
- close focused window
- cycle focus
Stage 6: Tiling
Start with one layout only.
Recommended first layouts:
- equal columns
- master-stack
Deliverable:
- new windows retile the workspace correctly
Stage 7: Workspaces
Implement:
- workspace switching
- moving windows between workspaces
- independent workspace layout state
Stage 8: Multi-output
Implement:
- output tracking
- per-output active workspace
- correct focus and new-window placement
Stage 9: Standalone session
Only after the nested compositor is solid, add:
- DRM/KMS
- libinput
- session/seat handling
- VT switching
Stage 10: Polish
Later features:
- config file
- IPC
- floating windows
- fullscreen
- layer-shell support
- screencopy
- animations
- XWayland
Suggested Layout
src/
main.rs
app.rs
state.rs
backend/
mod.rs
nested.rs
tty.rs
input/
mod.rs
keyboard.rs
pointer.rs
bindings.rs
layout/
mod.rs
columns.rs
master.rs
shell/
mod.rs
xdg.rs
window.rs
render/
mod.rs
scene.rs
workspace/
mod.rs
config/
mod.rs
Guiding rule:
- keep Smithay integration near the edges
- keep layout and workspace logic in plain Rust types
System Dependencies
The final compositor will also need Linux graphics/input libraries, depending on backend choice:
libwaylandlibxkbcommonlibudevlibinputlibdrmgbmegl/gles2pixmanxwaylandfor X11 clients
References
- Smithay docs: https://docs.rs/smithay/latest/smithay/
- Smithay project docs: https://smithay.github.io/smithay/smithay/
- wayland-server docs: https://smithay.github.io/wayland-rs/wayland_server/
- calloop docs: https://docs.rs/calloop/latest/calloop/
- xkbcommon docs: https://docs.rs/xkbcommon/latest/xkbcommon/
Status
Right now the repo is still at the very beginning. The current documentation is the roadmap.
For a fuller step-by-step build guide, see GUIDE.md.