diff options
| author | Davi Ribeiro <104164579+Markus328@users.noreply.github.com> | 2025-08-23 07:21:35 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-23 20:21:35 +1000 |
| commit | f747d82b9336bb7c691d39a1f001c0d30d7bfb95 (patch) | |
| tree | 3456b6a9ed002382593e653a48a85b141edcc424 /services/IdleInhibitor.qml | |
| parent | dashboard: better pfp picker (diff) | |
| download | caelestia-shell-f747d82b9336bb7c691d39a1f001c0d30d7bfb95.tar.gz caelestia-shell-f747d82b9336bb7c691d39a1f001c0d30d7bfb95.tar.bz2 caelestia-shell-f747d82b9336bb7c691d39a1f001c0d30d7bfb95.zip | |
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>
Diffstat (limited to 'services/IdleInhibitor.qml')
| -rw-r--r-- | services/IdleInhibitor.qml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/services/IdleInhibitor.qml b/services/IdleInhibitor.qml new file mode 100644 index 0000000..5bad30b --- /dev/null +++ b/services/IdleInhibitor.qml @@ -0,0 +1,36 @@ +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; + } + } +} |