Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

fix(desktop): Mercury's icon on notifications everywhere

Salman Qureshife18c068ec84
diff --git a/apps/desktop/public/notification-icon.png b/apps/desktop/public/notification-icon.png
new file mode 100644
index 00000000..e5063af3
Binary files /dev/null and b/apps/desktop/public/notification-icon.png differ
diff --git a/apps/desktop/scripts/icons/build.mjs b/apps/desktop/scripts/icons/build.mjs
index 794772b1..0d1a235a 100644
--- a/apps/desktop/scripts/icons/build.mjs
+++ b/apps/desktop/scripts/icons/build.mjs
@@ -28,6 +28,8 @@ writeFileSync(join(OUT, "icon-square.svg"), appIcon({ shape: "square" }));
for (const [name, px] of [["32x32.png", 32], ["64x64.png", 64], ["128x128.png", 128], ["[email protected]", 256], ["icon.png", 512]]) {
writeFileSync(join(OUT, name), square(px));
}
+// A browser notification's image (the desktop app bundles 128x128@2x for Linux).
+writeFileSync(join(OUT, "..", "..", "public", "notification-icon.png"), square(256));
// Windows Store / MSIX tiles.
for (const px of [30, 44, 71, 89, 107, 142, 150, 284, 310]) writeFileSync(join(OUT, `Square${px}x${px}Logo.png`), square(px));
diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json
index 476aa273..de5dbc41 100644
--- a/apps/desktop/src-tauri/tauri.conf.json
+++ b/apps/desktop/src-tauri/tauri.conf.json
@@ -56,6 +56,9 @@
"icons/icon.icns",
"icons/icon.ico"
],
+ "resources": {
+ "icons/[email protected]": "notification-icon.png"
+ },
"createUpdaterArtifacts": false,
"macOS": {
"minimumSystemVersion": "11.0",
diff --git a/apps/desktop/src/app/notify/notify.ts b/apps/desktop/src/app/notify/notify.ts
index baa00238..2c14899f 100644
--- a/apps/desktop/src/app/notify/notify.ts
+++ b/apps/desktop/src/app/notify/notify.ts
@@ -70,15 +70,36 @@ export async function askPermission(): Promise<Permission> {
try { return await Notification.requestPermission(); } catch { return "denied"; }
}
+/**
+ * The Mercury icon for a Linux notification. macOS and Windows always show
+ * the sending app's own icon; Linux looks one up by name in the icon theme,
+ * which only a .deb/.rpm install provides, so hand it the file itself.
+ */
+let linuxIcon: Promise<string | undefined> | null = null;
+function notificationIcon(): Promise<string | undefined> {
+ linuxIcon ??= (async () => {
+ try {
+ const { platform } = await import("@tauri-apps/plugin-os");
+ if (platform() !== "linux") return undefined;
+ const { resolveResource } = await import("@tauri-apps/api/path");
+ return await resolveResource("notification-icon.png");
+ } catch {
+ return undefined;
+ }
+ })();
+ return linuxIcon;
+}
+
async function systemNotify(title: string, body: string): Promise<boolean> {
try {
if (isTauri) {
const { sendNotification } = await import("@tauri-apps/plugin-notification");
- sendNotification({ title, body });
+ const icon = await notificationIcon();
+ sendNotification(icon ? { title, body, icon } : { title, body });
return true;
}
if (typeof Notification !== "undefined" && Notification.permission === "granted") {
- const n = new Notification(title, { body, silent: true });
+ const n = new Notification(title, { body, silent: true, icon: "/notification-icon.png" });
n.onclick = () => { window.focus(); n.close(); };
return true;
}