nosignal-shell/services/IdleInhibitor.qml
Davi Ribeiro f747d82b93
bar: add idle inhibitor (#459)
* 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>
2025-08-23 20:21:35 +10:00

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;
}
}
}