feat: Implemented launching and downloading of roms
This is just an initial implementation lots of kings to iron out
This commit is contained in:
parent
ef08fa6114
commit
f15bf9a1e0
117 changed files with 37776 additions and 1073 deletions
43
src/bun/api/system.ts
Normal file
43
src/bun/api/system.ts
Normal 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() })
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue