parent
510cb45ac1
commit
f484642971
1 changed files with 11 additions and 7 deletions
|
|
@ -2,6 +2,7 @@ pragma Singleton
|
||||||
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import Quickshell.Wayland
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -23,28 +24,31 @@ Singleton {
|
||||||
reloadableId: "idleInhibitor"
|
reloadableId: "idleInhibitor"
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
IdleInhibitor {
|
||||||
running: root.enabled
|
enabled: props.enabled
|
||||||
command: ["systemd-inhibit", "--what=idle", "--who=caelestia-shell", "--why=Idle inhibitor active", "--mode=block", "sleep", "inf"]
|
window: PanelWindow {
|
||||||
|
implicitWidth: 0
|
||||||
|
implicitHeight: 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
target: "idleInhibitor"
|
target: "idleInhibitor"
|
||||||
|
|
||||||
function isEnabled(): bool {
|
function isEnabled(): bool {
|
||||||
return root.enabled;
|
return props.enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle(): void {
|
function toggle(): void {
|
||||||
root.enabled = !root.enabled;
|
props.enabled = !props.enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
function enable(): void {
|
function enable(): void {
|
||||||
root.enabled = true;
|
props.enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function disable(): void {
|
function disable(): void {
|
||||||
root.enabled = false;
|
props.enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue