Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4fd98d934 |
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 201 B |
Binary file not shown.
|
After Width: | Height: | Size: 311 B |
@@ -6,6 +6,8 @@ directories:
|
||||
files:
|
||||
- out/**
|
||||
- package.json
|
||||
- assets/icon.png
|
||||
- assets/tray-icon*.png
|
||||
asar: true
|
||||
icon: assets/icon.png
|
||||
|
||||
|
||||
+1
-1
@@ -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.",
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user