Getting Started
Viewport is a Wayland compositor written in Rust whose entire shell — wallpaper, status bar, window frames, titlebars, launcher, lock screen and settings panel — is a web page, composited zero-copy alongside native Wayland and XWayland clients.
Smithay handles DRM/KMS, input and Wayland protocols. viewport-vulkan drives GPU compositing with HDR, real-time background blur and cross-GPU shadow buffers (with a GLES fallback). A browser engine renders the shell to a DMA-BUF. Neither ever hands a pixel to the CPU.
┌───────────────────────────────────────────────────┐
│ shell (HTML/CSS/JS, loaded from a URL) │
└──────────────────┬────────────────────────────────┘
│ DMA-BUF (Wayland client / WPE) ▲ JSON over IPC
▼ │ (Unix socket / WPE)
┌─────────────────────────────────────────────────────┴───┐
│ viewport (Rust · Smithay · viewport-vulkan / GLES) │
│ shell layer ← web shell DMA-BUF │
│ Space ← native Wayland & XWayland clients │
│ shell.overlay ← glass bar, menus, dialogs, OSK │
└──────────────────┬──────────────────────────────────────┘
▼ DrmOutput / atomic KMS commit
DRM/KMSQuick Start
Run Viewport directly from the Nix flake without compiling a browser engine:
nix run github:codebam/viewportIt nests inside your existing Wayland/X11 session when one is running, and takes the DRM device directly on a TTY when there is not. Press Mod4+Shift+e to quit, or pass -- --exit-after 30 to set an automatic timeout.
Control a running session
The same binary is the client for its own control socket:
viewport msg -t view.focus --id 12
viewport msg -t output.query --pretty
viewport msg -t subscribe view.focused # follow events until ^C
viewport msg -t quit # from a second TTY, if needed
viewport msg --help # every message and its fieldsEvery message in IPC and writing a shell can be sent this way under its wire name.
Installing
NixOS
flake.nix provides packages, dev shells and NixOS / Home Manager modules. Set programs.viewport.shellBackend to choose which browser engine draws the shell:
programs.viewport = {
enable = true;
shellBackend = "chromium"; # the default; also "webkitgtk", "cef",
# "wpe" or "servoshell"
};programs.viewport.chromiumBinarynames the browser thechromiumbackend drives (nixpkgs'chromiumby default, or any Chromium-family browser by path).userConfig = trueleaves configuration to~/.config/viewport/config.jsoninstead of generating one from module options (useful with Home Manager'sxdg.configFile).
Arch Linux / CachyOS
packaging/aur/ contains six PKGBUILDs across three engines (viewport-wpe, viewport-webkitgtk, viewport-chromium), each with a release and -git variant. Because wpewebkit with the WPE Platform API is already packaged on Arch, each builds in about a minute:
cd packaging/aur/viewport-wpe && makepkg -siAll variants install the viewport binary and register a wayland-sessions entry so display managers offer Viewport at login.
Building with Nix
nix build github:codebam/viewport # default — chromium
nix build github:codebam/viewport#chromium
nix build github:codebam/viewport#webkitgtk
nix build github:codebam/viewport#cef
nix build github:codebam/viewport#servoshell
nix build github:codebam/viewport#wpe # in-process; builds WPE WebKit from sourceSee Shell backends and Benchmarks to compare engine CPU, memory and frame pacing trade-offs.
Developing in the Tree
nix develop .#rust # Rust toolchain + test suite dependencies
cargo test --workspace
cargo build --bin viewport --bin viewport-shell-gtk
scripts/integration.sh target/debug/viewport # real Wayland clients, headlessRun nested against a shell you are actively editing:
cargo run --bin viewport -- --url http://localhost:3000Use --url-span on multi-monitor setups to span your development shell across every output instead of only the first screen. See Configuration and keybindings for all flags.
Workspace Layout
| Crate | Licence | Role |
|---|---|---|
crates/viewport | GPL-3.0-or-later | Main Wayland/XWayland compositor binary (viewport) and IPC CLI (viewport msg) |
crates/viewport-ipc | MIT | Wire protocol types, framing and CLI schema shared across compositor, CLI and shell bridges |
crates/viewport-shell-bridge | MIT | Shared out-of-process shell host and Chrome DevTools Protocol session logic |
crates/viewport-web | MIT | In-process WPE WebKit FFI shim (enabled with --features wpe) |
crates/viewport-shell-chromium | MIT | Default shell backend driving system Chromium over CDP |
crates/viewport-shell-gtk | MIT | Out-of-process WebKitGTK shell backend |
crates/viewport-shell-servoshell | MIT | Out-of-process Servo shell backend driving servoshell |
crates/viewport-shell-cef | MIT | Out-of-process embedded Blink shell backend via CEF (standalone workspace; requires CEF_PATH) |
crates/viewport-shell-servo | MIT | Out-of-process embedded Servo shell backend (standalone workspace; compiles servo from source) |
viewport-vulkan | MIT | Standalone Smithay Vulkan renderer with HDR, blur, ICC colour management and explicit sync |
Next Steps
- Understand the design philosophy in Why the shell is a web page.
- Customize keybindings, outputs, window rules and layouts in Configuration and keybindings.
- Extend the desktop with Shell extensions, Custom bar widgets, Layout extensions, or Wallpaper extensions.
- Build your own shell against IPC and writing a shell or inspect the minimal Kiosk example.