mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 05:02:50 +02:00
Package the Frame Control web UI as an installable Electron Mac app and bring in the tooling built alongside it. - app/: Electron wrapper that starts ui/server.py on a free loopback port, hardened window (sandbox, no navigation, runAsNode fuse off), login-shell PATH so Homebrew tools work from Finder, first-run offer to run connect.sh, ad-hoc signed DMG/zip via electron-builder. - ui/: headset view (OpenVR screenshots), device status, library, Steam "Get games" (owned games, install, store search), Android apps as persistent Lepton instances with a rated F-Droid catalogue and a private compatibility database, Android display controls over ADB, file and clipboard transfer, Flatpaks, remote and power actions. - apk-catalog/, compat-db/, frame/: catalogue build pipeline, Lakebed capsule for compatibility reports, Frame-side launchers. - tests/ and CI: server guard and validation tests plus Steam helper tests, run on Python 3.9 with script and app syntax checks. - Docs: README leads with the Mac app; new Android, panels, Steam games and field-notes docs; security notes on LAN-exposed ADB ports. Screenshot values for the headset's IP and Wi-Fi name are placeholders. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
33 lines
1.6 KiB
JavaScript
33 lines
1.6 KiB
JavaScript
// Renders build/icon.svg to icon.png (1024px) and icon.icns. Run: npm run icon
|
|
const { app, BrowserWindow } = require("electron");
|
|
const { execFileSync } = require("child_process");
|
|
const fs = require("fs");
|
|
const os = require("os");
|
|
const path = require("path");
|
|
|
|
app.dock?.hide();
|
|
app.whenReady().then(async () => {
|
|
const win = new BrowserWindow({ width: 1024, height: 1024, show: false, transparent: true, frame: false,
|
|
useContentSize: true, webPreferences: { offscreen: true } });
|
|
const svg = fs.readFileSync(path.join(__dirname, "icon.svg"), "utf8");
|
|
await win.loadURL("data:text/html," + encodeURIComponent(
|
|
`<body style="margin:0;background:transparent">${svg}</body>`));
|
|
await new Promise((r) => setTimeout(r, 300));
|
|
const png = (await win.webContents.capturePage({ x: 0, y: 0, width: 1024, height: 1024 }))
|
|
.resize({ width: 1024, height: 1024 }).toPNG();
|
|
fs.writeFileSync(path.join(__dirname, "icon.png"), png);
|
|
|
|
const set = fs.mkdtempSync(path.join(os.tmpdir(), "icon-")) + "/icon.iconset";
|
|
fs.mkdirSync(set);
|
|
for (const size of [16, 32, 128, 256, 512]) {
|
|
for (const scale of [1, 2]) {
|
|
const px = size * scale, name = `icon_${size}x${size}${scale === 2 ? "@2x" : ""}.png`;
|
|
execFileSync("sips", ["-z", String(px), String(px), path.join(__dirname, "icon.png"),
|
|
"--out", path.join(set, name)], { stdio: "ignore" });
|
|
}
|
|
}
|
|
execFileSync("iconutil", ["-c", "icns", set, "-o", path.join(__dirname, "icon.icns")]);
|
|
console.log("wrote build/icon.png and build/icon.icns");
|
|
app.quit();
|
|
});
|