From bf82bb32e2a5a7504f176305d41e3e9043934425 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Sun, 27 Apr 2025 08:37:33 -0300 Subject: [PATCH] :zap: ags(notifications): better icon-getting method --- ags/widget/Notification.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ags/widget/Notification.ts b/ags/widget/Notification.ts index a15ac8c..87c50b4 100644 --- a/ags/widget/Notification.ts +++ b/ags/widget/Notification.ts @@ -3,6 +3,7 @@ import AstalNotifd from "gi://AstalNotifd"; import { Separator } from "./Separator"; import { HistoryNotification, Notifications } from "../scripts/notifications"; import { GLib } from "astal"; +import { getAppIcon } from "../scripts/apps"; export function getUrgencyString(notif: AstalNotifd.Notification) { switch(notif.urgency) { @@ -77,14 +78,10 @@ export function NotificationWidget(notification: AstalNotifd.Notification|number children: [ new Widget.Icon({ className: "icon app-icon", - icon: (notification instanceof AstalNotifd.Notification) && Astal.Icon.lookup_icon(notification.appIcon) ? + icon: notification.appIcon && Astal.Icon.lookup_icon(notification.appIcon) ? notification.appIcon - : (Astal.Icon.lookup_icon(notification.appName.toLowerCase()) ? - notification.appName.toLowerCase() - : "image-missing" - ), - setup: (_) => _.get_icon() === "image-missing" && - _.set_visible(false), + : getAppIcon(notification.appName), + setup: (self) => self.set_visible(Boolean(self.get_icon())), halign: Gtk.Align.START, css: "font-size: 16px;" }),