wasmdesk

A WebAssembly desktop — its window manager and clients written in pure-Go Ruby.

pure Ruby window manager runs entirely in the browser WebAssembly · CGO=0 pure-Go widget toolkit 16 window-decoration presets GTK-theme aware (Adwaita · Juno · WhiteSur · Solarized) Wayland-inspired compositor full desktop environment (tray · notifications · Spotlight · Exposé) external clients (Worker + SharedArrayBuffer) Fluxbox-style dock / toolbar OCI-streamed apps no server-side code built on go-embedded-ruby
Live demo wasmbox wasmdock ociapps toolkit
built on go-embedded-ruby License: BSD-3-Clause WebAssembly

wasmdesk is a desktop environment that runs entirely in your browser. Its compositor, window-manager policy and clients are written in pure Ruby and run on go-embedded-ruby — a pure-Go (CGO=0) Ruby interpreter — compiled to js/wasm. There is no server-side code: the compositor owns the canvas, the stacking order and input routing, while external clients each run in their own Web Worker and paint into a SharedArrayBuffer. The compositor is a full desktop environment — dock, tray, notifications, applets, wallpaper, snapping, Alt-Tab, Exposé and a Spotlight launcher. Widgets in the clients come from a pure-Go toolkit with a GTK-theme loader; window decorations are pluggable via a Frame strategy — 16 combos ship in-tree, including ?frame=aqua-whitesur-light which reproduces macOS Big Sur near-pixel-accurate. Clients can be streamed at runtime from any OCI registry, or same-origin from GitHub Pages.

Compositor ready

wasmbox — a Wayland-inspired compositor with an Openbox-style window-manager policy: stacking order, click-to-focus, cascade placement, decorations and a requestAnimationFrame render loop with an idle-repaint dirty gate (~0 CPU idle), all written in pure Ruby and composited to a <canvas>. It boots behind a determinate, streamed-download splash.

Desktop environment ready

wasmbox is a whole DE, not just a window manager: a dock, a system tray, notification toasts (icon + multi-line + multi-action), desktop applets (live clock, a real Calendar), selectable wallpaper, window snapping / half-tiling, a visual Alt-Tab switcher, Exposé (F3) and a Spotlight launcher (⌘/Ctrl+Space) — all pure Ruby.

Dock / toolbar ready

wasmdock — a bottom-anchored, Fluxbox-style toolbar: launchers, a live window list (focus/close), a workspace switcher and a clock, with hover magnification, running/active indicators and right-click menus. It runs as a standalone external client and drives the compositor with launch/focus/close messages.

External-client protocol ready

Clients each run in their own Web Worker / WASM instance and paint into a SharedArrayBuffer, speaking a documented postMessage wire contract. The compositor itself runs in a dedicated worker rendering into an OffscreenCanvas (step C), and each client talks to it over a direct MessageChannel (step C.1). It owns the canvas, stacking and input routing.

OCI app streaming ready

ociapps — a pure-Go (CGO=0) library + CLIs that pack a client as an OCI image, push it (with ghcr token auth) to any Distribution v2 registry, and load it back into the browser with multi-registry fallback. A static /v2 mirror lets the whole desktop stream its apps same-origin from GitHub Pages — no CORS, no proxy.

Pure Ruby on WebAssembly ready

Everything builds on go-embedded-ruby, a pure-Go (CGO=0) Ruby interpreter compiled to js/wasm. The window manager is //go:embed-ed into one self-contained .wasm — no runtime fetch, no C toolchain, full Ruby dynamism.

Pure-Go widget toolkit ready

go-widgets/toolkit — pure-Go pixel-blitting widget set: Button, Label, Entry, TextView, Menu, MenuBar, Dialog, Tooltip, DropDown, TreeView, Toolbar, Statusbar, FileChooser, ColorChooser, Calendar, Notification and more, with AA-rendered OpenType-shaped text. 100% statement coverage. LoadGTKTheme(css) parses libadwaita/GTK3 @define-colorTheme.

Frame strategy (16 combos) ready

Pluggable window decorations via the compositor’s Frame class. 2 layouts (Openbox / Aqua) × 7 GTK palettes (Adwaita, Juno, WhiteSur, Solarized) = 16 registered presets. Pick via ?frame=NAME URL, or from the root menu → Frame. ?frame=aqua-whitesur-light reproduces macOS Big Sur near-pixel-accurate.

Toolkit-Showcase + Calculator ready

Two in-tree wasmbox clients that consume the toolkit end-to-end: Showcase exercises every widget family across a 7-tab Notebook, with a live GTK-theme picker in the View menu (9 palettes bundled). Calculator is a small focused consumer (Entry + 5×4 Button grid). Both at 100% coverage.

wasmaqua (archived) archived

The macOS-Aqua-themed sibling compositor is archived: its chrome is now bundled into wasmbox as the AquaFrame preset. wasmbox-serve -default-frame=aqua reproduces the old wasmaqua landing page. One binary, both looks (and 14 more themed combos).

The window-management logic — geometry, hit-testing, stacking, placement and focus — is plain Ruby with no reference to the JS bridge, so it is unit-tested natively; only the rendering methods touch the canvas. The dock's layout, magnification math, hit-testing and RGBA painting likewise live in a pure package at 100% test coverage, with a thin js/wasm shim for the SharedArrayBuffer glue. Because the whole stack is pure Go with cgo disabled, it cross-compiles trivially and ships as a single self-contained .wasm — no runtime fetch, no C toolchain. Everything is BSD-3-Clause.