blob: d65711e2f88776fa5610b97a928666debcf53eb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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": {} } });
}
}
}
|