feat: notifications o:

This commit is contained in:
Kat Inskip 2025-12-07 18:41:31 -08:00
parent 15ac9bfa2b
commit c98690fa63
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
5 changed files with 346 additions and 8 deletions

View file

@ -0,0 +1,38 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import Quickshell.Services.Notifications
Singleton {
id: root
NotificationServer {
id: notificationServer
imageSupported: true
bodySupported: true
bodyMarkupSupported: false
bodyImagesSupported: false
actionsSupported: true
onNotification: (notification) => {
notification.tracked = true;
root.notification(notification);
}
}
function clear(): void {
for (const notification of notificationServer.trackedNotifications.values) {
notification.tracked = false;
}
}
// TODO: use signal
property list<Notification> list: notificationServer.trackedNotifications.values.filter(notification => notification.tracked)
signal notification(Notification notification)
IpcHandler {
target: "notifications"
function clear() {
root.clear()
}
}
}