diff --git a/frontend/build/icon.png b/frontend/build/icon.png new file mode 100644 index 0000000..d02f1d6 Binary files /dev/null and b/frontend/build/icon.png differ diff --git a/frontend/electron/main.ts b/frontend/electron/main.ts index 6759ddc..dde0544 100644 --- a/frontend/electron/main.ts +++ b/frontend/electron/main.ts @@ -82,6 +82,18 @@ function resolveBackendPath(): string { return path.join(app.getAppPath(), '..', 'target', 'release', 'keynectr'); } +/** + * The app icon ships inside the bundle: Vite copies `public/icon.png` into + * `dist/`, so the packaged app finds it next to the loaded page. In dev the + * Vite project's `public/` folder is the same file. + */ +function resolveWindowIcon(): string { + const base = app.isPackaged + ? path.join(app.getAppPath(), 'dist') + : path.join(app.getAppPath(), 'public'); + return path.join(base, 'icon.png'); +} + function startBackend(): void { if (backendStarted && backend && backend.exitCode === null) { return; @@ -500,6 +512,7 @@ function createWindow(): void { minWidth: 920, minHeight: 640, title: 'Keynectr', + icon: resolveWindowIcon(), backgroundColor: '#f6f4f0', autoHideMenuBar: true, webPreferences: { diff --git a/frontend/package.json b/frontend/package.json index 7002d7b..6dadc90 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -65,6 +65,7 @@ "target": [ "dir" ], + "icon": "build/icon.png", "category": "Network", "executableName": "keynectr" } diff --git a/frontend/public/icon.png b/frontend/public/icon.png new file mode 100644 index 0000000..d02f1d6 Binary files /dev/null and b/frontend/public/icon.png differ