diff options
Diffstat (limited to 'appearance/Hypridle.qml')
| -rw-r--r-- | appearance/Hypridle.qml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/appearance/Hypridle.qml b/appearance/Hypridle.qml index e265b88..1696f5f 100644 --- a/appearance/Hypridle.qml +++ b/appearance/Hypridle.qml @@ -27,6 +27,8 @@ Singleton { property string prefix: "" property var listeners: [] property string tail: "" + property string notice: "" + property bool loaded: false function getField(body, key) { const m = body.match(new RegExp(`^\\s*${key}\\s*=\\s*(.+?)\\s*$`, "m")); @@ -143,6 +145,7 @@ listener { root.prefix = p.prefix; root.listeners = p.listeners; root.tail = p.tail; + root.loaded = true; } } } @@ -150,8 +153,9 @@ listener { FileView { id: confFile; path: root.confPath } function save() { - if (root.prefix === "") return; // not loaded yet: writing would truncate the file + if (!root.loaded) return; // not loaded yet: writing would truncate the file confFile.setText(root.serialize(root.prefix, root.listeners, root.tail)); Quickshell.execDetached(["sh", "-c", "pkill -x hypridle; setsid -f hypridle"]); + root.notice = "saved; idle timers reset"; } } |
