notification button
This commit is contained in:
parent
e964ee2337
commit
65b4762c90
5 changed files with 86 additions and 3 deletions
25
services/Notifications.qml
Normal file
25
services/Notifications.qml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property bool hasNotifications: notifications.length > 0
|
||||
property list<Notification> notifications: []
|
||||
|
||||
function clear() {
|
||||
notifications.forEach(notification => {
|
||||
notification.dismiss();
|
||||
});
|
||||
notifications = [];
|
||||
}
|
||||
|
||||
NotificationServer {
|
||||
onNotification: event => {
|
||||
event.tracked = true;
|
||||
root.notifications.push(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue