From 24922be5e9261f78ef6f0f2b57815880a889ebf7 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 17 Sep 2025 23:15:47 +1000 Subject: feat: add idle monitor Replaces hypridle --- modules/IdleMonitors.qml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 modules/IdleMonitors.qml (limited to 'modules/IdleMonitors.qml') diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml new file mode 100644 index 0000000..ed929c4 --- /dev/null +++ b/modules/IdleMonitors.qml @@ -0,0 +1,37 @@ +import "lock" +import qs.config +import qs.services +import Quickshell +import Quickshell.Wayland + +Scope { + id: root + + required property Lock lock + + IdleMonitor { + timeout: Config.general.idle.lockTimeout + onIsIdleChanged: { + if (isIdle) + root.lock.lock.locked = true; + } + } + + IdleMonitor { + timeout: Config.general.idle.dpmsTimeout + onIsIdleChanged: { + if (isIdle) + Hypr.dispatch("dpms off"); + else + Hypr.dispatch("dpms on"); + } + } + + IdleMonitor { + timeout: Config.general.idle.sleepTimeout + onIsIdleChanged: { + if (isIdle) + Quickshell.execDetached(["systemctl", "suspend-then-hibernate"]); + } + } +} -- cgit v1.2.3-freya