diff --git a/assets/tray-icon.png b/assets/tray-icon.png new file mode 100644 index 00000000..7453a119 Binary files /dev/null and b/assets/tray-icon.png differ diff --git a/assets/tray-icon@2x.png b/assets/tray-icon@2x.png new file mode 100644 index 00000000..c4922587 Binary files /dev/null and b/assets/tray-icon@2x.png differ diff --git a/assets/tray-iconTemplate.png b/assets/tray-iconTemplate.png new file mode 100644 index 00000000..4801ceb5 Binary files /dev/null and b/assets/tray-iconTemplate.png differ diff --git a/assets/tray-iconTemplate@2x.png b/assets/tray-iconTemplate@2x.png new file mode 100644 index 00000000..72c59429 Binary files /dev/null and b/assets/tray-iconTemplate@2x.png differ diff --git a/electron-builder.yml b/electron-builder.yml index 062a9ce0..85edb63b 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -6,6 +6,8 @@ directories: files: - out/** - package.json + - assets/icon.png + - assets/tray-icon*.png asar: true icon: assets/icon.png diff --git a/package.json b/package.json index 8ef59e7c..82c6bc20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agent-company", - "version": "0.4.90", + "version": "0.4.91", "private": true, "type": "module", "description": "Cross-platform Electron desktop control plane for local-first AI agent companies.", diff --git a/src/main/desktop-shell-service.ts b/src/main/desktop-shell-service.ts index c0db9818..53e4306a 100644 --- a/src/main/desktop-shell-service.ts +++ b/src/main/desktop-shell-service.ts @@ -1,5 +1,5 @@ import { existsSync } from "node:fs"; -import { extname } from "node:path"; +import { extname, dirname, join } from "node:path"; import { pathToFileURL } from "node:url"; import { resolve, sep } from "node:path"; import { @@ -275,11 +275,38 @@ export function createDesktopShellService({ } function createTray() { - if (process.platform === "darwin" || appTray) { + if (appTray) { return; } - const trayIcon = nativeImage.createFromPath(iconPath); + const assetsDir = dirname(iconPath); + let trayIcon: Electron.NativeImage; + + if (process.platform === "darwin") { + // macOS menu bar: use Template images (monochrome black + alpha). + // Electron auto-detects the @2x variant when the base name includes "Template". + const templatePath = join(assetsDir, "tray-iconTemplate.png"); + trayIcon = nativeImage.createFromPath(templatePath); + if (!trayIcon.isEmpty()) { + trayIcon.setTemplateImage(true); + } + } else { + // Windows / Linux: use the color tray icon + const trayPath = join(assetsDir, "tray-icon.png"); + trayIcon = nativeImage.createFromPath(trayPath); + } + + // Fallback: resize the full app icon + if (trayIcon.isEmpty()) { + const fallback = nativeImage.createFromPath(iconPath); + if (!fallback.isEmpty()) { + trayIcon = fallback.resize({ width: 32, height: 32 }); + if (process.platform === "darwin") { + trayIcon.setTemplateImage(true); + } + } + } + appTray = new Tray(trayIcon.isEmpty() ? nativeImage.createEmpty() : trayIcon); appTray.setToolTip("AgentCompany"); appTray.setContextMenu(