Publish bytecode release package

This commit is contained in:
2026-06-19 16:36:24 +03:00
commit 2f72a440d1
26 changed files with 306 additions and 0 deletions
@@ -0,0 +1,45 @@
import streamDeck, { SingletonAction } from "@elgato/streamdeck";
import { spawn } from "node:child_process";
import { existsSync, readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const pluginDir = dirname(dirname(fileURLToPath(import.meta.url)));
const launcherConfig = join(pluginDir, "launcher.json");
const fallbackLauncher = "F:\\AI\\TopSecretProjects\\ffmpeg-projects\\rimpac_gif_creator\\rimpac_gif_creator.vbs";
function getAppLauncher() {
if (!existsSync(launcherConfig)) {
return fallbackLauncher;
}
try {
const config = JSON.parse(readFileSync(launcherConfig, "utf8"));
return config.appLauncher || fallbackLauncher;
} catch {
return fallbackLauncher;
}
}
class LaunchGifCreatorAction extends SingletonAction {
manifestId = "com.rimpac.gif-creator.launch";
async onKeyDown(ev) {
const appLauncher = getAppLauncher();
if (!existsSync(appLauncher)) {
streamDeck.logger.error(`Launcher not found: ${appLauncher}`);
await ev.action.showAlert();
return;
}
const child = spawn("wscript.exe", [appLauncher], {
detached: true,
stdio: "ignore",
windowsHide: true,
});
child.unref();
await ev.action.showOk();
}
}
streamDeck.actions.registerAction(new LaunchGifCreatorAction());
streamDeck.connect();