diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-01-21 14:34:21 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-01-21 14:34:21 -0500 |
| commit | 2c0dd689145e48e9d3683dfd3556723895fa54aa (patch) | |
| tree | b2c37ae5136ec90c0f1fea16da6266857f886573 /modules/IdleMonitors.qml | |
| parent | remove config saving, make background scale properly, and add quickshell desk... (diff) | |
| download | caelestia-shell-2c0dd689145e48e9d3683dfd3556723895fa54aa.tar.gz caelestia-shell-2c0dd689145e48e9d3683dfd3556723895fa54aa.tar.bz2 caelestia-shell-2c0dd689145e48e9d3683dfd3556723895fa54aa.zip | |
Diffstat (limited to 'modules/IdleMonitors.qml')
| -rw-r--r-- | modules/IdleMonitors.qml | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml deleted file mode 100644 index b7ce058..0000000 --- a/modules/IdleMonitors.qml +++ /dev/null @@ -1,51 +0,0 @@ -pragma ComponentBehavior: Bound - -import "lock" -import qs.config -import qs.services -import Caelestia.Internal -import Quickshell -import Quickshell.Wayland - -Scope { - id: root - - required property Lock lock - readonly property bool enabled: !Config.general.idle.inhibitWhenAudio || !Players.list.some(p => p.isPlaying) - - function handleIdleAction(action: var): void { - if (!action) - return; - - if (action === "lock") - lock.lock.locked = true; - else if (action === "unlock") - lock.lock.locked = false; - else if (typeof action === "string") - Hypr.dispatch(action); - else - Quickshell.execDetached(action); - } - - LogindManager { - onAboutToSleep: { - if (Config.general.idle.lockBeforeSleep) - root.lock.lock.locked = true; - } - onLockRequested: root.lock.lock.locked = true - onUnlockRequested: root.lock.lock.unlock() - } - - Variants { - model: Config.general.idle.timeouts - - IdleMonitor { - required property var modelData - - enabled: root.enabled && (modelData.enabled ?? true) - timeout: modelData.timeout - respectInhibitors: modelData.respectInhibitors ?? true - onIsIdleChanged: root.handleIdleAction(isIdle ? modelData.idleAction : modelData.returnAction) - } - } -} |