Gamerig Library: gamerig's game library as a Chandra desktop module
CI / test (push) Successful in 2m25s

- New desktop module gamerig-library (components/gamerig-library, logic in lib/gamelib): the
  layout of gamerig's web library (desktop/ui) in draw ops. Top bar with the Gamerig mark, app
  count and search; sidebar with categories and counts, running apps (switch to, stop) and rig
  status (GPU, display, audio); card grid with featured games two columns wide, icon tiles,
  category and status badges, description, install hint, Launch / Big Picture / Switch to / Stop.
  Typing filters, arrows + Enter launch, the wheel scrolls. Colours: follow desktop, dark, light.
- New game-library capability: tables 26-28 (status, games, launch modes), request 45, in the
  wasmer/wasmtime stub, the MoonBit wasmhost and the Rust host-wasm.
- compositor/shell/gamelib.mbt polls GET $GAMERIG_DESKTOP_API/api/state (default
  http://127.0.0.1:8091) every 2 s with curl on a socket and POSTs launch/stop/focus; a file://
  base reads a state file (tests).
- --desktop NAME picks what fills the desktop at start. scripts/gamerig-kiosk.sh now runs a
  hybrid kiosk with the library as the desktop (CHANDRA_KIOSK_MODE=strict for the old one).
- Tests: lib/gamelib, compositor/host/gamelib_test.mbt, a host-wasm test; docs/gamerig-library.md
  with a screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgvjzw8hHirxRsXSsE
This commit is contained in:
Claude committed 2026-11-26 02:57:07 +00:00
1 parent fa932f9ac0
commit f556df2f4b
57 files changed
+3551 -29

No files matched your search

+4 -2
View File
@@ -86,7 +86,7 @@ NVIDIA Xorg :0 ─────────────── Selkies (ximagesrc
| # | Gap | Effort | Risk | Status |
| --- | --- | --- | --- | --- |
| G1 | Kiosk profile: no panel, shortcuts off, desktop menus off, focused window fullscreen, app restarted with backoff, admin escape, `chandra-ctl kiosk`; `--app-id` for the X window's class; `scripts/gamerig-kiosk.sh` | 1 day | low | **done** (d521d0d), rig test pending |
| G2 | **Native launcher module**: the calm library as a Chandra desktop module (desktop modules exist since 0f71779): grid, categories, search, running apps, rig status, logs, add app. Needs a capability for modules to call server.py's HTTP API (or the daemon's catalog/launch logic as a host capability) | 1-2 weeks | medium (UI parity; no HTML/CSS engine, so it is a re-implementation sharing calm's tokens) | to do; removes WebKit (≈ 67 MiB) |
| G2 | **Native launcher module**: the calm library as a Chandra desktop module (desktop modules exist since 0f71779): grid, categories, search, running apps, rig status, logs, add app. Needs a capability for modules to call server.py's HTTP API (or the daemon's catalog/launch logic as a host capability) | 1-2 weeks | medium (UI parity; no HTML/CSS engine, so it is a re-implementation sharing calm's tokens) | **library done**: `gamerig-library` desktop module + `game-library` capability (the shell polls server.py), [gamerig-library.md](gamerig-library.md); Add App and logs still to do; removes WebKit (≈ 67 MiB) |
| G3 | **Chandra as the X11 window manager** (replaces Openbox and the fullscreen watcher): `SubstructureRedirect` on the root, map games fullscreen and borderless, leave dialogs (Steam login, file pickers) floating, focus, stacking, `_NET_ACTIVE_WINDOW` / `_NET_CLIENT_LIST` so `wmctrl`/`xdotool` keep working, follow `xrandr`, Ctrl+Alt+L / Super+Space / Alt+Tab across X and Wayland windows. Chandra already speaks the X11 protocol in MoonBit (`compositor/x11`); this is gamerig's own M3 "MoonBit X11 WM" | 1-2 weeks | medium (Steam's odd windows) | to do; removes Openbox (≈ 52 MiB) |
| G4 | Gamepad navigation for modules: read the joystick evdev devices Selkies creates (libinput ignores pads; on `--x11` there is no libinput at all), a WIT gamepad event, focus movement in the launcher | 2-4 days | low | to do |
| G5 | Clipboard bridge between X (Selkies) and Chandra's Wayland clients | 1-2 days | low | to do, only for apps inside Chandra |
@@ -111,7 +111,9 @@ Xorg itself stays (≈ 50 MiB est.); replacing it is the Wayland route below and
1. **Stage 1 (built): Chandra as the library window.** `scripts/gamerig-kiosk.sh` on a running rig,
or G6 in onstart. Same library (WebKit inside Chandra), same everything else. Proves the X path
on NVIDIA: capture, XTest input, resize, Ctrl+Alt+L, game on top, back to the library.
2. **Stage 2: native launcher module** (G2 + G4). Drops WebKit from the image. The library becomes
2. **Stage 2: native launcher module** (G2 + G4). Built as a hybrid kiosk: `gamerig-kiosk.sh`
now runs `--kiosk-hybrid --desktop gamerig-library` (panel, dock and Alt+Tab work; Log out and
power are locked), so the library needs no WebKit. Drops WebKit from the image. The library becomes
gamepad-navigable inside the stream.
3. **Stage 3: Chandra as the window manager** (G3). Drops Openbox and the watcher; the Alt+Tab and
"back to library" logic moves into one place.