* bar: add idle inhibitor * bar: change idle inhibitor button color * nix: link external scripts instead of install * services/idleinhibitor: add IPC handler * better styling * move cpp scripts to assets/cpp --------- Co-authored-by: Soramane <61896496+soramanew@users.noreply.github.com>
36 lines
689 B
QML
36 lines
689 B
QML
pragma Singleton
|
|
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
|
|
Singleton {
|
|
id: root
|
|
|
|
property bool enabled: false
|
|
|
|
Process {
|
|
id: idleInhibitProc
|
|
running: root.enabled
|
|
command: [Quickshell.env("CAELESTIA_II_PATH") || "/usr/lib/caelestia/inhibit_idle"]
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|