The web-based Wayland compositor.
  • Rust 43.2%
  • Python 30.3%
  • TypeScript 12.1%
  • C++ 4.5%
  • JavaScript 3.2%
  • Other 6.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-03 08:48:34 -05:00
.agents/skills Initial commit 2026-11-03 08:48:34 -05:00
.cargo Initial commit 2026-11-03 08:48:34 -05:00
compositor-roots Initial commit 2026-11-03 08:48:34 -05:00
comraw Initial commit 2026-11-03 08:48:34 -05:00
integrations Initial commit 2026-11-03 08:48:34 -05:00
packaging Initial commit 2026-11-03 08:48:34 -05:00
roots Initial commit 2026-11-03 08:48:34 -05:00
src Initial commit 2026-11-03 08:48:34 -05:00
tests Initial commit 2026-11-03 08:48:34 -05:00
wosh Initial commit 2026-11-03 08:48:34 -05:00
.dockerignore Initial commit 2026-11-03 08:48:34 -05:00
.gitignore Initial commit 2026-11-03 08:48:34 -05:00
.gitmodules Initial commit 2026-11-03 08:48:34 -05:00
.python-version Initial commit 2026-11-03 08:48:34 -05:00
1 Initial commit 2026-11-03 08:48:34 -05:00
Cargo.lock Initial commit 2026-11-03 08:48:34 -05:00
Cargo.toml Initial commit 2026-11-03 08:48:34 -05:00
config.example.toml Initial commit 2026-11-03 08:48:34 -05:00
hi.png Initial commit 2026-11-03 08:48:34 -05:00
justfile Initial commit 2026-11-03 08:48:34 -05:00
LICENSE Initial commit 2026-11-03 08:48:34 -05:00
PKGBUILD Initial commit 2026-11-03 08:48:34 -05:00
README.md Initial commit 2026-11-03 08:48:34 -05:00
RENDERER_REVIEW.md Initial commit 2026-11-03 08:48:34 -05:00
startup-metrics.log Initial commit 2026-11-03 08:48:34 -05:00
whatever.txt Initial commit 2026-11-03 08:48:34 -05:00

wo compositor

Wo is a Smithay Wayland compositor with WPE WebKit hosted by Wosh. Its compositor surfaces use WPEPlatform's Wayland backend and DMA-BUF rendering. The portal backend is available as xdg-desktop-portal-wo; run wo portals to start it directly. The packaged xdg-desktop-portal configuration also starts it on demand.

User-local install

With Rust, Bun, and Python 3 installed, run just install from this checkout as your desktop user. The recipe refuses to install into /root when invoked from a root shell. It builds Wo, WPE WebKit, Wosh, and comraw, then installs them under ~/.local and $XDG_DATA_HOME/wo. On first install it copies config.example.toml to $XDG_CONFIG_HOME/wo/config.toml and configures the copied comraw build to be served locally. Existing user configuration is preserved. Add ~/.local/bin to PATH and select the Wo session from your display manager.

just build and just dev build WPE WebKit, JavaScriptCore, and Wosh's WPE runtime adapter. Both use Clang and Mold for native links. Release Rust uses LLVM, while the dev recipe uses Cranelift for Rust. Wo defaults to Wosh. The WPE launcher selects WPEPlatform's Wayland backend and requires EGL plus negotiated DMA-BUF rendering formats. WebGL and ANGLE are enabled in the WPE build and runtime. The WPE Wayland backend rejects shared-memory output, so Wosh surfaces reach Wo through DMA-BUF buffers only. Wo applies the source patches in packaging/wpe/patches before configuring WPE.

Build caches, Rust toolchains, Bun caches, WPE source, and engine outputs are kept under ignored target/. Set WO_BUILD_TOOL_ROOT, WO_WPE_SOURCE, or WO_WPE_BUILD_DIR to relocate them. When CCache is installed, WPE and the Wosh adapter use it automatically with a cache under target/wpe-cache; set CCACHE_DIR to move that cache. Its default size limit is 20 GiB, adjustable with CCACHE_MAXSIZE.

From a local TTY login, run wo --drm as your desktop user. The packaged display-manager session uses the same command. Wo resolves and activates the process's logind session before opening DRM and input devices, switches its VT to graphics mode, and restores console display and keyboard modes on exit. wo --nested explicitly starts a window inside an existing graphical session. An explicit LIBSEAT_BACKEND=seatd continues to use seatd for seat ownership.

RPM packaging

On Fedora or openSUSE, run just rpm-buildenv to install RPM build prerequisites and prepare the local build tree. Run just rpm to build binary and source RPMs under target/rpm-build. See packaging/rpm/README.md for isolated Fedora builds with mock.

Debian and Ubuntu packaging

On Ubuntu or Debian, run just ubuntu-deb to build an architecture-native .deb from source. The package is written to target/ubuntu-package/. See packaging/ubuntu/README.md for build prerequisites and installation details.

Arch Linux packaging

On Arch Linux, build and install the source package with makepkg -si from the repository root. The PKGBUILD builds Wo, WPE WebKit, Wosh, and comraw from source and packages the Wayland session and desktop portal configuration.

Portal requests in the Wo API

Renderer code can subscribe to compositor-mediated requests and resolve them through the context-isolated API. Requests are denied by default if the application does not respond.

const unsubscribe = window.woClient.portals.onRequest(async ({ requestId, payload }) => {
  const allowed = await showConsentDialog(payload);
  await window.woClient.portals.respond(requestId, {
    allowed,
    type: 'monitor', // or 'window'
    windowName: null,
  });
});

The API is also available as window.compositor.portals in compositor UI contexts. Portal approval transport uses a per-user runtime socket with owner only permissions.

Desktop and system APIs

Wo exposes a typed convenience layer as window.compositor and window.woClient:

const directories = await window.compositor.xdg.directories();
const apps = await window.compositor.desktop.applications.list();
await window.compositor.desktop.applications.launch('org.gnome.Terminal.desktop');
const icon = await window.compositor.icons.resolve('utilities-terminal', { size: 48 });
const names = await window.compositor.dbus.listNames('user');

Desktop entries are read from the XDG data directories, localized names and user directories are honored, icons are resolved from XDG icon themes, and desktop Exec fields are launched as argument vectors without a shell. The D-Bus helpers use busctl; call arguments should include a D-Bus signature. window.compositor.audio lists PipeWire audio sources and can forward PCM from a desktop monitor source to the renderer. PipeWire and pw-cat must be available. Audio forwarding is exposed separately from ScreenCast because the standard XDG ScreenCast stream contains video, not a companion audio stream.

Shell scripts can call the compositor through wo bridge. The command sends a JSON-RPC method over Wo's Unix socket, for example wo bridge wo.ping or wo bridge wo.files.list '{"path":"/tmp"}'. Methods are explicitly named and permission checked. The bridge does not expose arbitrary command execution.

Website-first Wo API and component overlays

Wo treats loaded pages as websites first: ordinary pages receive no compositor bridge. A site can publish /_wo.capabilities.json and /_wo.components.css. The manifest requests named APIs and binds the request to the exact index.html SHA-256, a stylesheet SHA-256, and SHA-256 values for its script assets. Wo prefetches and verifies those files before navigation, caches verified assets by URL and hash, then asks the user before exposing the requested API groups. Granting access applies only to that page/window; a top-level navigation revokes it. Scripts for a manifest-enabled page are served from Wo's verified cache, and unlisted script loads are blocked. A saved grant is reused only for the same origin, document hash, declared script hashes, and capability request.

The available permission names are window-management, overlay-rendering, desktop-applications, xdg, dbus, portals, filesystem, process-launch, system-control, notifications, audio-capture, and settings. A page can inspect window.wo.permissions.requested, .granted, and .has(name). The compositor bridge groups (window.compositor and window.woClient) are present only after at least one API group is approved; unapproved groups are omitted and their IPC operations remain denied by the main process.

Pages granted portals can open a desktop context menu with await window.wo.portals.contextMenu({ x, y, items }). It resolves with the selected item ID after dismissal. The WPE shell delegates the menu to the native desktop popup implementation, so Wayland presents it as a popup surface and it uses the desktop's native menu theme. Root portal UIs such as comraw's screen share prompt can be themed with _wo.components.css.

Comraw publishes _wo.capabilities.json, its schema, and _wo.components.css from comraw/public. The schema is _wo.capabilities.schema.json. Its Vite production build writes the current index.html hash, stylesheet hash, and script hashes into the public manifest, so the request stays tied to the exact build. The development server generates the matching index and stylesheet hashes on request. Wo sends the verified document and stylesheet bytes to the compositor, which computes SHA-256 itself and stores both hashes against the owning window. _wo.components.css provides component theme tokens and keyboard focus styling that Wo preloads and applies to the page. Websites can use the same manifest format to request a window surface or use the overlay-rendering bridge for HTML/CSS/JS surfaces.

API consent is remembered per origin and exact site build. Wo records the verified HTML hash, the declared JavaScript asset hashes, and the requested capability set. The grant survives restarts; changing the HTML, a declared script, or requested capabilities produces a new consent request. Sites with settings can use window.wo.settings (get, set, remove, keys) for persistent JSON values. Wo keeps each web origin in its own user settings file with owner-only permissions, so apps can share their settings across pages on the same origin without sharing them with other hosts. Store passwords and tokens with getSecret, setSecret, and removeSecret; Wo encrypts these using GNOME Keyring/Secret Service or KDE Wallet and declines secret writes when a secure desktop keyring is unavailable.

Sites with window-management can subscribe to the compositor's monitor layout with window.wo.windows?.monitors(callback). Sites with overlay-rendering can pin an element to a monitor's global desktop rectangle:

const unmount = window.wo.overlay?.mount(element, monitor.id);
// Call unmount() to restore the element's original inline positioning.

Monitor coordinates are global desktop coordinates, so pointer positions and window placement remain consistent when an element is mounted on another display.

Comraw is a bare tiling window manager with no launcher, panels, or menus. Native windows are arranged master/stack on the primary monitor: the master window takes the left column, every other window splits the right column, and dialogs stay floating. The shell hit-tests its rendered window surfaces and forwards pointer, wheel, and keyboard input to the owning window through wo.input.*, which is what lets clients receive input and gain focus. It registers global keybinds with the compositor (wo.windows.keybind) and handles the wo:keybind actions they emit:

Keybind Action
Super+w/a/s/d Focus the window above/left/below/right
Super+Shift+w/a/s/d Swap the focused window in that direction
Super+Tab / Super+Shift+Tab Cycle focus through the tiling order
Super+Return Promote the focused window to master
Super+r Cycle the master width ratio
Super+Space Open the application runner
Super+f Toggle fullscreen on the focused window
Super+q Close the focused window
Super+Shift+Return Launch a terminal
Super+Ctrl+q Quit the session

The runner is a Rofi-like typeahead over installed desktop applications: typing filters, Enter launches the selection, Escape closes it. Opening the runner issues the blur window action, which hands keyboard focus back to the shell page so keystrokes reach the runner; closing it restores focus to the previously focused window.

Window geometry changes glide onto their tile through a short eased animation of move/resize actions, and the focus hairline transitions with the window. The shell paints its own desktop background (a gradient), so the view is never bare white; the default is the elementary OS wallpaper "A Large Body of Water Surrounded By Mountains" (Unsplash license), and placing a wallpaper.png in the served root overrides it.

Scrolling with the pointer over the bare desktop cycles focus through the tiling order; holding Shift moves the focused window through the order instead. A one-pixel inset hairline marks the focused window.

The DRM backend discovers connected outputs, assigns compatible CRTCs, places them side by side, and composites the shared desktop scene into a per-output swapchain. Native Wayland windows use the same global Smithay Space and can span monitors. Newly connected DRM outputs are detected by a two-second topology poll and attached when a compatible free CRTC is available. Unplug cleanup and live mode replacement are not implemented yet; restart Wo after removing a monitor or changing its mode. Workspace hiding is driven by wo.windows.action workspace-hide/workspace-show; it does not isolate native Wayland clients. Portal monitor capture currently publishes the primary output rather than a stitched multi-monitor image.

WPE GPU rendering

WPE WebKit and JavaScriptCore build from the pinned source release. The Wo Wayland client negotiates DMA-BUF formats with Smithay, and Wo imports WPE surface buffers directly for composition. The WPE build enables WebGL, which selects WebKit's ANGLE support, and the launcher verifies EGL and DMA-BUF availability before creating a view. Wo logs if WPE falls back to shared memory. GPU format and modifier support depends on the active driver.

Wo applies the local WebKit patch series from packaging/wpe/patches before building. Release and development engine artifacts are isolated under target/wpe-build-clang-mold and target/wpe-install.

GPU rendering and native input

Wo's compositor and WPE use EGL. The WPE Wayland platform connects to Wo's Wayland socket and uses renderer-advertised DMA-BUF feedback. Wo's nested backend prefers an inherited WAYLAND_DISPLAY, or discovers a wayland-* socket under XDG_RUNTIME_DIR when launchers omit that variable.

Wayland clients receive pointer motion, buttons, scroll axes, relative pointer motion, and locked-pointer cursor hints through Smithay's native protocols. Forwarded input accounts for client-surface geometry offsets so window borders and client-side decorations do not skew pointer coordinates.

Headless tests

Run unit tests with just test. This runs Rust and the @wl-wo/roots API tests without starting a compositor. The startup selector tests cover a TTY that inherits stale Wayland or X11 environment variables.

Run just test-nested to build Wo and run it under Xvfb with Mesa software rendering. This exercises the WPE shell, Wayland globals, output frame submission, and session-lock request and release. It requires Xvfb, wayland-info, and swaylock.

Run just test-container to build an isolated Fedora test image and execute the unit and nested suites inside it. Podman or Docker must be installed on the host. The test image uses the same Bun COPR package source as the RPM build.

For direct TTY and DRM coverage, use a virtual machine with systemd-logind and a virtual GPU, log in to a text VT, and run just test-vm. See tests/vm/README.md. Containers do not provide an isolated VT or logind seat, so this path belongs in a VM.

Wo compositor helper library

roots/ contains the framework-independent @wl-wo/roots TypeScript helpers for building compositor frontends over @wl-wo/wo-types. createWoRoots(window.wo) exposes capability-aware helpers, with filesystem access, application discovery, notifications, and system control calling the compositor through JSON-RPC. Methods return a Result<T> that distinguishes missing permission, unavailable bridge APIs, and operation failures. capabilitiesFor(...) maps helper groups to manifest permission names.

The StatusNotifier helper can discover services that Wo's D-Bus bridge can read and call, resolve their named icons, and dispatch activate, secondary activate, context menu, and scroll methods. A full StatusNotifier host also needs D-Bus name ownership and signal subscriptions, which the current Wo bridge does not expose. The library intentionally reports the bridge boundary instead of claiming to provide that host lifecycle.

The comraw build copies this package to node_modules/@wl-wo/roots. Built output includes a generated /_wo.capabilities.json with the HTML, script, and stylesheet hashes plus _wo.capabilities.schema.json. Update the requested API groups in roots/scripts/wo-manifest.mjs when the built-in shell's needs change.

import { createWoRoots, capabilitiesFor } from "@wl-wo/roots";

const roots = createWoRoots(window.wo);
const requested = capabilitiesFor("basic-shell", "applications", "tray", "settings");
const apps = await roots.applications.list();
const stopTray = roots.tray.subscribe(items => console.log(items));
const settings = await roots.settings.get("panel");

roots.settings wraps Wo's origin-isolated persistent app settings and secrets. For desktop service values and methods, use roots.system.dbus or roots.system.getProperty and roots.system.call.

React compositor abstraction

compositor-roots/ provides the base @wl-wo/compositor-roots package for class-based React compositors. Decorated methods define shell and window components, and @Inject(...) declares the refs, Wo window props, and window actions supplied to each method. The host handles window geometry, dragging, and focus order without adding a visual theme. See compositor-roots/README.md for usage and current API boundaries.