Skip to content

The VS Code of video editing, built for agents.

TypeScript

Enhance Electron app initialization with custom development icon for macOS

konstantin-paulus6588dca62f51
diff --git a/apps/desktop/assets/icon-dev.png b/apps/desktop/assets/icon-dev.png
new file mode 100644
index 00000000..d0c82c23
Binary files /dev/null and b/apps/desktop/assets/icon-dev.png differ
diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts
index 4be02df8..d608a746 100644
--- a/apps/desktop/src/main.ts
+++ b/apps/desktop/src/main.ts
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-import { app, BrowserWindow, session, shell } from "electron";
+import { app, BrowserWindow, nativeImage, session, shell } from "electron";
import { join } from "node:path";
import { open, unlink } from "node:fs/promises";
import { randomUUID } from "node:crypto";
@@ -218,6 +218,11 @@ if (app.requestSingleInstanceLock()) {
});
app.whenReady().then(() => {
+ if (!app.isPackaged && process.platform === "darwin") {
+ const devIcon = nativeImage.createFromPath(join(app.getAppPath(), "assets", "icon-dev.png"));
+ if (!devIcon.isEmpty()) app.dock?.setIcon(devIcon);
+ }
+
setupAppMenu();
session.defaultSession.setPermissionRequestHandler((_wc, _permission, callback) => callback(true));
session.defaultSession.setPermissionCheckHandler(() => true);