summaryrefslogtreecommitdiff
path: root/modules/IdleMonitors.qml
diff options
context:
space:
mode:
authorSoramane <61896496+soramanew@users.noreply.github.com>2025-09-26 14:35:54 +1000
committerSoramane <61896496+soramanew@users.noreply.github.com>2025-09-26 14:35:54 +1000
commitdc986c00aa441f555e86449ccd044e24fa56a33a (patch)
tree11d54c955084fd9fc898ce0c27c167f31a672154 /modules/IdleMonitors.qml
parentnix: add clazy to devshell (diff)
downloadcaelestia-shell-dc986c00aa441f555e86449ccd044e24fa56a33a.tar.gz
caelestia-shell-dc986c00aa441f555e86449ccd044e24fa56a33a.tar.bz2
caelestia-shell-dc986c00aa441f555e86449ccd044e24fa56a33a.zip
plugin: add sleep notifier
Lock before sleep
Diffstat (limited to 'modules/IdleMonitors.qml')
-rw-r--r--modules/IdleMonitors.qml12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml
index 3e98bc5..a3179e3 100644
--- a/modules/IdleMonitors.qml
+++ b/modules/IdleMonitors.qml
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
import "lock"
import qs.config
import qs.services
+import Caelestia.Internal
import Quickshell
import Quickshell.Wayland
@@ -17,15 +18,22 @@ Scope {
return;
if (action === "lock")
- root.lock.lock.locked = true;
+ lock.lock.locked = true;
else if (action === "unlock")
- root.lock.lock.locked = false;
+ lock.lock.locked = false;
else if (typeof action === "string")
Hypr.dispatch(action);
else
Quickshell.execDetached(action);
}
+ SleepNotifier {
+ onAboutToSleep: {
+ if (Config.general.idle.lockBeforeSleep)
+ root.lock.lock.locked = true;
+ }
+ }
+
Variants {
model: Config.general.idle.timeouts