From dd2df931a3be1a6518c1e9fbff438de4274456cd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 11 Sep 2025 22:52:35 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell/NiriIdle.qml | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 accounts/gkleen@sif/shell/quickshell/NiriIdle.qml (limited to 'accounts/gkleen@sif/shell/quickshell/NiriIdle.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/NiriIdle.qml b/accounts/gkleen@sif/shell/quickshell/NiriIdle.qml new file mode 100644 index 00000000..faa77c3f --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/NiriIdle.qml @@ -0,0 +1,30 @@ +import QtQml +import Quickshell +import Quickshell.Wayland +import qs.Services +import Custom as Custom + +Scope { + IdleMonitor { + id: idleMonitor30 + timeout: 30 + + onIsIdleChanged: Custom.Systemd.setIdleHint(idleMonitor30.isIdle) + } + IdleMonitor { + id: idleMonitor540 + timeout: 540 + + onIsIdleChanged: { + if (idleMonitor540.isIdle) + NiriService.sendCommand({ "Action": "PowerOffMonitors" }); + } + } + Connections { + target: Custom.Systemd + function onSleep(before: bool) { + if (!before) + NiriService.sendCommand({ "Action": "PowerOnMonitors" }); + } + } +} -- cgit v1.2.3