From 82e9396cb8c16cb44d8615b85711798a3182691c Mon Sep 17 00:00:00 2001 From: DhanushSantosh Date: Thu, 26 Feb 2026 17:49:26 +0530 Subject: [PATCH] fix: use absolute icon path and place icon outside asar on Linux The hicolor icon theme index only lists sizes up to 512x512, so an icon installed only at 1024x1024 is invisible to GNOME/KDE's theme resolver, causing both the app launcher and taskbar to show a generic icon. Additionally, BrowserWindow.icon cannot be read by the window manager when the file is inside app.asar. - extraResources: copy logo_larger.png to resources/ (outside asar) so it lands at /opt/Automaker/resources/logo_larger.png on install - linux.desktop.Icon: set to the absolute resources path, bypassing the hicolor theme lookup and its size constraints entirely - icon-manager.ts: on Linux production use process.resourcesPath so BrowserWindow receives a real filesystem path the WM can read directly Co-Authored-By: Claude Sonnet 4.6 --- apps/ui/package.json | 9 ++++++++- apps/ui/src/electron/utils/icon-manager.ts | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/apps/ui/package.json b/apps/ui/package.json index 0d04a111..066bc429 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -202,6 +202,10 @@ "filter": [ "**/*" ] + }, + { + "from": "public/logo_larger.png", + "to": "logo_larger.png" } ], "mac": { @@ -261,7 +265,10 @@ "maintainer": "webdevcody@gmail.com", "executableName": "automaker", "description": "An autonomous AI development studio that helps you build software faster using AI-powered agents", - "synopsis": "AI-powered autonomous development studio" + "synopsis": "AI-powered autonomous development studio", + "desktop": { + "Icon": "/opt/Automaker/resources/logo_larger.png" + } }, "rpm": { "depends": [ diff --git a/apps/ui/src/electron/utils/icon-manager.ts b/apps/ui/src/electron/utils/icon-manager.ts index 7a0dda14..c3985738 100644 --- a/apps/ui/src/electron/utils/icon-manager.ts +++ b/apps/ui/src/electron/utils/icon-manager.ts @@ -21,18 +21,23 @@ export function getIconPath(): string | null { let iconFile: string; if (process.platform === 'win32') { iconFile = 'icon.ico'; - } else if (process.platform === 'darwin') { - iconFile = 'logo_larger.png'; } else { iconFile = 'logo_larger.png'; } // __dirname is apps/ui/dist-electron (Vite bundles all into single file) - // In production the asar layout is: /dist-electron/main.js and /dist/logo_larger.png - // Vite copies public/ assets to the root of dist/, NOT dist/public/ - const iconPath = isDev - ? path.join(__dirname, '../public', iconFile) - : path.join(__dirname, '../dist', iconFile); + let iconPath: string; + if (isDev) { + iconPath = path.join(__dirname, '../public', iconFile); + } else if (process.platform === 'linux') { + // On Linux, use the icon copied to resourcesPath via extraResources. + // This places it outside app.asar so the window manager can read it + // directly, and matches the absolute path used in the .desktop entry. + iconPath = path.join(process.resourcesPath, iconFile); + } else { + // macOS / Windows: icon is inside the asar; Electron handles it natively. + iconPath = path.join(__dirname, '../dist', iconFile); + } try { if (!electronAppExists(iconPath)) {