diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2026-09-23 21:08:35 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2026-09-23 21:08:35 +0200 |
| commit | ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71 (patch) | |
| tree | 141f738276cf84c6b7e5633c2bd5f2b44e9b0b75 /accounts/gkleen@skadhi/shell/quickshell/NiriIdle.qml | |
| parent | 6a763272038e637a8a03dd9059d43a1ff44921dd (diff) | |
| download | nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.gz nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.bz2 nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.tar.xz nixos-ae9a80c1f012686c1f65fce7ce76fdd1b77b0b71.zip | |
...
Diffstat (limited to 'accounts/gkleen@skadhi/shell/quickshell/NiriIdle.qml')
| -rw-r--r-- | accounts/gkleen@skadhi/shell/quickshell/NiriIdle.qml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/accounts/gkleen@skadhi/shell/quickshell/NiriIdle.qml b/accounts/gkleen@skadhi/shell/quickshell/NiriIdle.qml new file mode 100644 index 00000000..beff205c --- /dev/null +++ b/accounts/gkleen@skadhi/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 | } | ||
