lock: lazy load locker

This commit is contained in:
2 * r + 2 * t 2025-06-22 20:56:13 +10:00
parent 2a652d549a
commit 3a66c4941e

View file

@ -6,18 +6,29 @@ import Quickshell.Io
import Quickshell.Wayland
Scope {
LazyLoader {
id: loader
WlSessionLock {
id: lock
locked: true
onLockedChanged: {
if (!locked)
loader.active = false;
}
LockSurface {
lock: lock
}
}
}
CustomShortcut {
name: "lock"
description: "Lock the current session"
onPressed: lock.locked = true
onPressed: loader.activeAsync = true
}
CustomShortcut {
@ -30,7 +41,7 @@ Scope {
target: "lock"
function lock(): void {
lock.locked = true;
loader.activeAsync = true;
}
}
}