diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-11 22:52:35 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-11 22:52:35 +0200 |
commit | dd2df931a3be1a6518c1e9fbff438de4274456cd (patch) | |
tree | 50d203bcaa0e2d3af8f2d88536e38e0f0ee81c67 /accounts/gkleen@sif/shell/quickshell/NiriIdle.qml | |
parent | aebd3235d755cb1ff95995b461e497fea2d52e8b (diff) | |
download | nixos-dd2df931a3be1a6518c1e9fbff438de4274456cd.tar nixos-dd2df931a3be1a6518c1e9fbff438de4274456cd.tar.gz nixos-dd2df931a3be1a6518c1e9fbff438de4274456cd.tar.bz2 nixos-dd2df931a3be1a6518c1e9fbff438de4274456cd.tar.xz nixos-dd2df931a3be1a6518c1e9fbff438de4274456cd.zip |
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/NiriIdle.qml')
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell/NiriIdle.qml | 30 |
1 files changed, 30 insertions, 0 deletions
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 @@ | |||
1 | import QtQml | ||
2 | import Quickshell | ||
3 | import Quickshell.Wayland | ||
4 | import qs.Services | ||
5 | import Custom as Custom | ||
6 | |||
7 | Scope { | ||
8 | IdleMonitor { | ||
9 | id: idleMonitor30 | ||
10 | timeout: 30 | ||
11 | |||
12 | onIsIdleChanged: Custom.Systemd.setIdleHint(idleMonitor30.isIdle) | ||
13 | } | ||
14 | IdleMonitor { | ||
15 | id: idleMonitor540 | ||
16 | timeout: 540 | ||
17 | |||
18 | onIsIdleChanged: { | ||
19 | if (idleMonitor540.isIdle) | ||
20 | NiriService.sendCommand({ "Action": "PowerOffMonitors" }); | ||
21 | } | ||
22 | } | ||
23 | Connections { | ||
24 | target: Custom.Systemd | ||
25 | function onSleep(before: bool) { | ||
26 | if (!before) | ||
27 | NiriService.sendCommand({ "Action": "PowerOnMonitors" }); | ||
28 | } | ||
29 | } | ||
30 | } | ||