nosignal-shell/modules/lock/Lock.qml
2026-03-22 06:02:19 +11:00

59 lines
1 KiB
QML

pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import qs.components.misc
Scope {
property alias lock: lock
WlSessionLock {
id: lock
signal unlock
LockSurface {
lock: lock
pam: pam
}
}
Pam {
id: pam
lock: lock
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "lock"
description: "Lock the current session"
onPressed: lock.locked = true
}
// qmllint disable unresolved-type
CustomShortcut {
// qmllint enable unresolved-type
name: "unlock"
description: "Unlock the current session"
onPressed: lock.unlock()
}
IpcHandler {
function lock(): void {
lock.locked = true;
}
function unlock(): void {
lock.unlock();
}
function isLocked(): bool {
return lock.locked;
}
target: "lock"
}
}