feat: add notifications widget

This commit is contained in:
tux
2025-06-13 23:12:11 +05:30
parent e042268846
commit e93f98d154
8 changed files with 219 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
import { Gtk } from "astal/gtk4";
import Notifd from "gi://AstalNotifd";
import { fileExists, isIcon } from "./notifd";
export const Icon = (notification: Notifd.Notification) => {
const icon =
notification.image || notification.appIcon || notification.desktopEntry;
if (!icon) return null;
if (fileExists(icon))
return (
<box hexpand={false} vexpand={false} valign={Gtk.Align.CENTER}>
<image file={icon} />
</box>
);
else if (isIcon(icon))
return (
<box hexpand={false} vexpand={false} valign={Gtk.Align.CENTER}>
<image iconName={icon} />
</box>
);
};