blob: 0e1c8356ae753f39dd6116248b2d2184e2c5e20a (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
|
pragma Singleton
import Quickshell
import Quickshell.Io
Singleton {
id: root
property alias enabled: props.enabled
PersistentProperties {
id: props
property bool enabled
reloadableId: "idleInhibitor"
}
Process {
running: root.enabled
command: ["systemd-inhibit", "--what=idle", "--who=caelestia-shell", "--why=Idle inhibitor active", "--mode=block", "sleep", "inf"]
}
IpcHandler {
target: "idleInhibitor"
function isEnabled(): bool {
return root.enabled;
}
function toggle(): void {
root.enabled = !root.enabled;
}
function enable(): void {
root.enabled = true;
}
function disable(): void {
root.enabled = false;
}
}
}
|