From f8cf761fa6f52feb15146bf1a0f1b7bfce51c343 Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 27 Aug 2026 11:28:18 -0400 Subject: [PATCH] notifications: prefer the icon theme for path app_icons fixes #2746 --- quickshell/Services/NotificationService.qml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/quickshell/Services/NotificationService.qml b/quickshell/Services/NotificationService.qml index 1fb050d36..6bbf54449 100644 --- a/quickshell/Services/NotificationService.qml +++ b/quickshell/Services/NotificationService.qml @@ -792,6 +792,21 @@ Singleton { return Paths.strip(image); } + // Apps like kitty send app_icon as their bundled logo path; the themed icon wins when the basename resolves (#2746). + function notificationThemedAppIcon(appIcon) { + if (/^https?:\/\//.test(appIcon)) + return ""; + const path = appIcon.startsWith("file://") ? appIcon.substring(7) : appIcon; + if (!path.startsWith("/")) + return ""; + const file = path.substring(path.lastIndexOf("/") + 1); + const dot = file.lastIndexOf("."); + const base = dot > 0 ? file.substring(0, dot) : file; + if (!base) + return ""; + return Paths.themedIconPath(base) ? base : ""; + } + function notificationImageSource(image, appIcon) { image = image || ""; appIcon = appIcon || ""; @@ -801,6 +816,8 @@ Singleton { return ""; if (!appIcon) return ""; + if (notificationThemedAppIcon(appIcon)) + return ""; return /^(file|https?):\/\//.test(appIcon) || appIcon.includes("/") ? appIcon : ""; } @@ -810,6 +827,9 @@ Singleton { const fromImage = notificationIconFromImage(image); if (notificationImageHasSpecialPrefix(image)) return fromImage; + const themed = notificationThemedAppIcon(appIcon); + if (themed) + return themed; return appIcon || fromImage || ""; }