mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
feat: notifications o:
This commit is contained in:
parent
15ac9bfa2b
commit
c98690fa63
5 changed files with 346 additions and 8 deletions
38
quickshell/DataSources/Notifications.qml
Normal file
38
quickshell/DataSources/Notifications.qml
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue