feat: Implemented launching and downloading of roms

This is just an initial implementation lots of kings to iron out
This commit is contained in:
Simeon Radivoev 2026-02-19 16:10:29 +02:00
parent ef08fa6114
commit f15bf9a1e0
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
117 changed files with 37776 additions and 1073 deletions

43
src/bun/api/system.ts Normal file
View file

@ -0,0 +1,43 @@
import Elysia from "elysia";
import open from 'open';
import z from "zod";
import os from 'node:os';
import { events } from "./app";
import { isSteamDeckGameMode } from "../utils";
// steam://open/keyboard?XPosition=%i&YPosition=%i&Width=%i&Height=%i&Mode=%d
export const system = new Elysia({ prefix: '/api/system' })
.post('/show_keyboard', async () =>
{
if (isSteamDeckGameMode())
{
open('steam://open/keyboard');
}
})
.get('/info', () =>
{
return {
homeDir: os.homedir(),
user: os.userInfo().username,
arch: os.arch(),
platform: os.platform(),
hostname: os.hostname(),
steamDeck: process.env.SteamDeck,
machine: os.machine()
};
})
.post('/exit', () =>
{
if (process.env.PUBLIC_ACCESS)
{
return;
}
events.emit('exitapp');
})
.post('/open', async ({ query: { url } }) =>
{
open(url);
}, {
query: z.object({ url: z.url() })
});