aboutsummaryrefslogtreecommitdiffstats
path: root/shared/Notify.qml
diff options
context:
space:
mode:
Diffstat (limited to 'shared/Notify.qml')
-rw-r--r--shared/Notify.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/shared/Notify.qml b/shared/Notify.qml
index ff07575..897e50b 100644
--- a/shared/Notify.qml
+++ b/shared/Notify.qml
@@ -39,6 +39,14 @@ Singleton {
// Epoch milliseconds; 0 means not snoozing.
property double snoozeUntil: 0
+ // Read from the status registry's own file rather than from the Status
+ // singleton. The renderers only read DND; referencing Status here would
+ // instantiate it, and its onPresentationChanged writes status.dnd and
+ // shells out to breaktimer.sh, side effects a read-only consumer must not
+ // trigger. The file is the interface, so reading it directly is the same
+ // value with none of the write side.
+ property bool dnd: false
+
function parseQueue() {
try { root.queue = JSON.parse(queueFile.text() || "[]"); }
catch (e) { root.queue = []; }
@@ -109,6 +117,16 @@ Singleton {
}
FileView {
+ id: dndFile
+ path: (Quickshell.env("XDG_RUNTIME_DIR") || "/tmp") + "/status.dnd"
+ watchChanges: true
+ printErrors: false
+ onFileChanged: reload()
+ onLoaded: root.dnd = dndFile.text().trim() === "1"
+ onLoadFailed: root.dnd = false
+ }
+
+ FileView {
id: snoozeFile
path: root.dir + "/snooze"
watchChanges: true