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
@@ -743,6 +743,13 @@ pub(all) enum HostTable {
|
||||
FaceStatus
|
||||
/// Enrolled faces (ss: label added).
|
||||
Faces
|
||||
/// Game library status (ssssssii: error gpu resolution display audio hostname connected
|
||||
/// audio-ok; one row), served by `game-library.status`.
|
||||
GameStatus
|
||||
/// Games (ssssssiii: id name category description icon install-hint featured installed running).
|
||||
Games
|
||||
/// Extra launch modes (sss: game id label).
|
||||
GameModes
|
||||
}
|
||||
|
||||
///| Publish `t` as the data behind `which` for every module's next call.
|
||||
@@ -764,6 +771,9 @@ pub fn publish(which : HostTable, t : Table) -> Unit {
|
||||
Desktops => 20
|
||||
FaceStatus => 24
|
||||
Faces => 25
|
||||
GameStatus => 26
|
||||
Games => 27
|
||||
GameModes => 28
|
||||
}
|
||||
let out : Array[Byte] = []
|
||||
for k = 0; k < 4; k = k + 1 {
|
||||
@@ -853,6 +863,8 @@ pub(all) enum HostRequest {
|
||||
/// The face-unlock capability: a face index removes it; -1 refresh, -2 enroll, -3 / -4 stop /
|
||||
/// start using it for the password dialog and sudo.
|
||||
FaceUnlock(Int)
|
||||
/// The game-library capability: 0 launch (game, mode), 1 stop, 2 focus (game), 3 refresh.
|
||||
GameLibrary(Int, String, String)
|
||||
} derive(Eq, Debug)
|
||||
|
||||
///|
|
||||
@@ -896,6 +908,14 @@ pub fn next_request() -> HostRequest? {
|
||||
19 => Some(DefaultApp(c_host_req_int()))
|
||||
40 => Some(SetDesktop(c_host_req_int()))
|
||||
44 => Some(FaceUnlock(c_host_req_int()))
|
||||
45 => {
|
||||
let code = c_host_req_int()
|
||||
let s = req_str()
|
||||
match s.find("\u{1f}") {
|
||||
Some(i) => Some(GameLibrary(code, s[:i].to_string(), s[i + 1:].to_string()))
|
||||
None => Some(GameLibrary(code, s, ""))
|
||||
}
|
||||
}
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user