diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-16 12:30:30 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-16 12:30:30 +0200 |
| commit | 5cdbc880afa6201f8aa289d52e434d04ecdc2c84 (patch) | |
| tree | 19d4b54d5343271fb723ec8d26cf4fb3ab98cc1d /appearance | |
| parent | f0a2bd6eac3adf78c0f8227a99e8be775ddbbd26 (diff) | |
| download | quickshell-5cdbc880afa6201f8aa289d52e434d04ecdc2c84.tar.gz quickshell-5cdbc880afa6201f8aa289d52e434d04ecdc2c84.zip | |
fix(appearance): refuse to save hypridle before the config has loaded
save() could run before refresh()'s async cat completed, when prefix and
tail are empty and listeners is empty, so it would write an empty file and
restart hypridle with no listeners. The real config always has a general
block, so an empty prefix means the load has not happened or failed.
Diffstat (limited to 'appearance')
| -rw-r--r-- | appearance/Hypridle.qml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/appearance/Hypridle.qml b/appearance/Hypridle.qml index 38a3483..e265b88 100644 --- a/appearance/Hypridle.qml +++ b/appearance/Hypridle.qml @@ -150,6 +150,7 @@ listener { FileView { id: confFile; path: root.confPath } function save() { + if (root.prefix === "") 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"]); } |
