Gamerig Library: gamerig's game library as a Chandra desktop module
CI / test (push) Successful in 2m25s
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:
57 files changed
+3551
-29
No files matched your search
@@ -373,3 +373,57 @@ interface face-unlock {
|
||||
/// Read the status and the faces again.
|
||||
refresh: func();
|
||||
}
|
||||
|
||||
/// A game library (docs/gamerig-library.md): the games and apps a game-streaming rig offers, what
|
||||
/// runs, and the rig's GPU, display and audio. The host gets all of it from gamerig's library
|
||||
/// daemon (`GET /api/state` on 127.0.0.1:8091, or GAMERIG_DESKTOP_API), polled every couple of
|
||||
/// seconds; the module never talks to the network itself. Launch, stop and focus go back to the
|
||||
/// daemon, which starts games on the rig's X server.
|
||||
interface game-library {
|
||||
record rig-status {
|
||||
/// Why the daemon can't be reached ("Library daemon not reachable"), or what the last action
|
||||
/// said went wrong; empty when all is well.
|
||||
error: string,
|
||||
gpu: string,
|
||||
resolution: string,
|
||||
display: string,
|
||||
audio: string,
|
||||
hostname: string,
|
||||
/// The daemon answered the last poll.
|
||||
connected: bool,
|
||||
audio-ok: bool,
|
||||
}
|
||||
record game {
|
||||
id: string,
|
||||
name: string,
|
||||
/// games, launchers or tools.
|
||||
category: string,
|
||||
description: string,
|
||||
/// An icon name from gamerig's catalog (Play, Sparkles, Folder, Star, Box, Terminal,
|
||||
/// Settings, ExternalLink ...).
|
||||
icon: string,
|
||||
/// What to do when it can't start (not installed).
|
||||
install-hint: string,
|
||||
featured: bool,
|
||||
installed: bool,
|
||||
running: bool,
|
||||
}
|
||||
/// A way to start a game other than plain Launch (Steam's Big Picture).
|
||||
record launch-mode {
|
||||
game: string,
|
||||
id: string,
|
||||
label: string,
|
||||
}
|
||||
status: func() -> rig-status;
|
||||
/// In catalog order.
|
||||
games: func() -> list<game>;
|
||||
launch-modes: func() -> list<launch-mode>;
|
||||
/// Start `game` (`mode` "default", or one of its launch modes).
|
||||
launch: func(game: string, mode: string);
|
||||
/// Stop it (SIGTERM, then SIGKILL).
|
||||
stop: func(game: string);
|
||||
/// Raise its window over the desktop.
|
||||
focus: func(game: string);
|
||||
/// Poll the daemon again now.
|
||||
refresh: func();
|
||||
}
|
||||
+13
-1
@@ -70,7 +70,10 @@ interface plasmoids {
|
||||
/// shortcuts (ssssi: name binding default-binding conflict capturing), 11 default-app
|
||||
/// categories (sss: name current missing), 12 default-app choices (issii: category id name icon current),
|
||||
/// 20 desktops (s: name) served by `wallpaper.desktops`, 24 face unlock status (sssiii: problem howdy
|
||||
/// message installed in-use busy; one row), 25 enrolled faces (ss: label added).
|
||||
/// message installed in-use busy; one row), 25 enrolled faces (ss: label added), 26 game library status (one row,
|
||||
/// ssssssii: error gpu resolution display audio hostname connected audio-ok),
|
||||
/// 27 games (ssssssiii: id name category description icon install-hint featured installed running),
|
||||
/// 28 launch modes (sss: game id label).
|
||||
publish-table: func(which: u32, rows: list<u8>);
|
||||
/// Layout mode (0 tiling, 1 monocle, 2 floating) and whether the Interface Explorer is on.
|
||||
publish-state: func(layout-mode: s32, inspector-on: bool);
|
||||
@@ -117,6 +120,13 @@ interface plasmoids {
|
||||
password: string,
|
||||
}
|
||||
|
||||
/// A game library action: 0 launch (game, mode), 1 stop, 2 focus (game), 3 poll again.
|
||||
record game-request {
|
||||
action: s32,
|
||||
game: string,
|
||||
mode: string,
|
||||
}
|
||||
|
||||
/// A module moving a panel instance `delta` places (negative: towards the start).
|
||||
record instance-move {
|
||||
slot: string,
|
||||
@@ -165,6 +175,8 @@ interface plasmoids {
|
||||
/// The face-unlock capability: an index removes that face; -1 reads the status again, -2
|
||||
/// enrolls a face, -3 / -4 stop / start using it for the password dialog and sudo.
|
||||
face-unlock(s32),
|
||||
/// The game-library capability: launch, stop, focus or refresh.
|
||||
game-library(game-request),
|
||||
}
|
||||
/// The next pending request, oldest first.
|
||||
next-request: func() -> option<request>;
|
||||
|
||||
@@ -103,6 +103,7 @@ world plasmoid-host {
|
||||
import shortcuts;
|
||||
import default-apps;
|
||||
import face-unlock;
|
||||
import game-library;
|
||||
export plasmoid;
|
||||
}
|
||||
|
||||
@@ -168,3 +169,12 @@ 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;
|
||||
}
|
||||
Reference in new issue
Block a user