notifications working (totally) perfectly
This commit is contained in:
31
Services/NotificationManager.qml
Normal file
31
Services/NotificationManager.qml
Normal file
@@ -0,0 +1,31 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property alias notif: server
|
||||
|
||||
function getLatestNotification() {
|
||||
let notificationList = server.trackedNotifications.values;
|
||||
let len = notificationList.length;
|
||||
if (len <= 0) {
|
||||
len = 1;
|
||||
}
|
||||
let latestNotification = notificationList[len - 1];
|
||||
return latestNotification;
|
||||
}
|
||||
|
||||
NotificationServer {
|
||||
id: server
|
||||
|
||||
bodyMarkupSupported: true
|
||||
bodySupported: true
|
||||
|
||||
onNotification: notification => {
|
||||
notification.tracked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Services/qmldir
Normal file
3
Services/qmldir
Normal file
@@ -0,0 +1,3 @@
|
||||
module Services
|
||||
singleton Time 1.0 Time.qml
|
||||
singleton NotificationManager 1.0 NotificationManager.qml
|
||||
Reference in New Issue
Block a user