Files
chandra/wit/worlds.wit
T
Claude f556df2f4b
CI / test (push) Successful in 2m25s
Gamerig Library: gamerig's game library as a Chandra desktop module
- 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
2026-11-26 02:57:07 +00:00

181 lines
5.1 KiB
Plaintext

package chandra:desktop@0.1.0;
/// Minimum every widget gets: theme tokens. Everything else is opt-in.
world widget {
import theme;
export plasmoid;
}
world clock-widget {
include widget;
import clock;
export module-config;
}
/// The optional `module-config` export on its own. A module of any world may add it to get its own
/// settings in its right-click menu; hosts look it up separately (host-wasm binds it with this world).
world configurable {
export module-config;
}
/// The optional `desktop-module` export on its own (wit/desktop.wit): what makes a module a
/// desktop module. Hosts look it up by name like `module-config` (host-wasm binds this world).
world desktop-export {
export desktop-module;
}
/// The application launcher. The launcher's popup
/// also ends in a session row: Reload, Log out, Suspend, Restart, Power off.
world launcher-widget {
include widget;
import app-catalog;
import app-launch;
import icons;
import session;
import power;
}
/// The dock: pinned apps plus running ones, with their theme icons, a dot per open window, a click
/// that starts the app or brings its windows forward, and right-click settings (icon size,
/// magnification, running apps). The shell keeps the pinned list (hidden `pinned` setting) and
/// draws the per-app right-click menu (Pin, Move, Quit), sharing lib/dock's layout.
world dock-widget {
include widget;
import app-catalog;
import app-launch;
import windows;
import icons;
export module-config;
}
world panel {
import theme;
export panel-layout;
}
/// Reference shell: panel + desktop background in one component.
world shell {
import theme;
export desktop-surface;
export panel-layout;
}
/// Desktop Pulse: reads machine state and the window list, and can raise a window.
world pulse-widget {
include widget;
import system;
import windows;
}
/// Layout switcher.
world layout-widget {
include widget;
import layout-control;
}
/// Interface Explorer toggle.
world inspector-widget {
include widget;
import inspector;
}
/// Everything a panel module can be granted. The native host instantiates any module against this
/// one world (a module simply imports the subset it uses) and serves each import from the data the
/// compositor publishes (wit/host/plasmoids.wit).
world plasmoid-host {
import theme;
import clock;
import app-catalog;
import app-launch;
import windows;
import layout-control;
import inspector;
import modules;
import system;
import session;
import wallpaper;
import session-settings;
import icons;
import screenshot;
import power;
import battery;
import network;
import shortcuts;
import default-apps;
import face-unlock;
import game-library;
export plasmoid;
}
/// The settings module: session switches (restore, window places, dark mode), the wallpaper, the
/// panel's modules (load, unload, browse; the panel menu's "Modules..." opens that tab), and power
/// (idle timeouts, battery, suspend / restart / power off), keyboard shortcuts (rebind, reset),
/// default apps (browser, email, files, terminal, editor, viewers and players) and face unlock.
world session-settings-widget {
include widget;
import session-settings;
import wallpaper;
import modules;
import power;
import system;
import shortcuts;
import default-apps;
import face-unlock;
}
/// Screenshot and screen recording launcher.
world screenshot-widget {
include widget;
import screenshot;
}
/// Battery charge, charging state and time left in the panel; its right-click settings choose what
/// shows.
world battery-widget {
include widget;
import battery;
export module-config;
}
/// Network status (Ethernet, Wi-Fi name and signal, offline) and a popup to pick a Wi-Fi network,
/// connect, disconnect, and switch Wi-Fi or airplane mode.
world network-widget {
include widget;
import network;
}
/// A desktop module (wit/desktop.wit): a plasmoid drawn full screen behind the windows. The
/// minimum: theme tokens in, draw ops and input, the animation clock.
world desktop-widget {
include widget;
export desktop-module;
}
/// Sample desktop module: app icons on the desktop. Click one to start the app, drag it to
/// arrange the grid (positions are kept as a hidden setting); arrow keys, Enter and typing pick
/// one. Its settings choose how many apps and how big.
world icon-desktop-widget {
include desktop-widget;
import app-catalog;
import app-launch;
import icons;
export module-config;
}
/// Sample desktop module: an animated starfield replacing the wallpaper. The pointer steers it,
/// the wheel changes speed, a click sends a warp pulse; it animates at 30 frames a second and
/// sleeps when its settings say Still.
world starfield-widget {
include desktop-widget;
export module-config;
}
/// Desktop module: gamerig's library as the desktop. A sidebar with the categories and their
/// counts, what is running and the rig's status; a search box; cards for each game with Launch,
/// Big Picture, Stop and Switch to. Built for a game-streaming rig in a hybrid kiosk.
world gamerig-library-widget {
include desktop-widget;
import game-library;
export module-config;
}