pi-ext
bugabingas pi extensions
owned by bugabinga
skill(quickshell): add notification daemon example (08)
33cea99deb0061c09cc72d67c2bcde87aba4d355
Review <review@example.invalid> ·
unsigned
Browse filesCompare with HEAD
Changed files (1)
skills/quickshell/examples/08-notification-daemon/shell.qml
Addednew file mode 100644 11 +import Quickshell.Services.Notifications
17 + NotificationServer {
21 + actionsSupported:
true 22 + bodyMarkupSupported:
true 23 + persistenceSupported:
true 24 + bodyHyperlinksSupported:
true 25 + bodyImagesSupported:
true 26 + inlineReplySupported:
true 30 + onNotification: (notification)
=> {
31 + notification.tracked
= true 33 + if (notification.expireTimeout
> 0) {
34 + dismissTimer(notification)
40 + function dismissTimer(notif) {
41 + const ms
= notif.expireTimeout
* 1000 42 + expireTimer.createObject(root, {
51 + property
var target:
null 54 + onTriggered:
if (target) target.tracked
= false 60 + model: server.trackedNotifications
61 + delegate: PanelWindow {
63 + required property
var modelData
66 + anchors.bottom:
true 67 + margins.bottom:
30 + (index
* 80)
72 + color:
"transparent" 76 + anchors.fill: parent
79 + border.color:
"#444" 83 + anchors.fill: parent
88 + text: popupWindow.modelData
? popupWindow.modelData.summary
: "" 92 + elide:
Text.ElideRight
96 + text: popupWindow.modelData
? popupWindow.modelData.body
: "" 100 + width: parent.width
101 + visible: text.length
> 0