diff options
Diffstat (limited to 'modules/lock/Lock.qml')
| -rw-r--r-- | modules/lock/Lock.qml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/lock/Lock.qml b/modules/lock/Lock.qml new file mode 100644 index 0000000..1eca886 --- /dev/null +++ b/modules/lock/Lock.qml @@ -0,0 +1,36 @@ +pragma ComponentBehavior: Bound + +import "root:/widgets" +import Quickshell +import Quickshell.Io +import Quickshell.Wayland + +Scope { + WlSessionLock { + id: lock + + LockSurface { + lock: lock + } + } + + CustomShortcut { + name: "lock" + description: "Lock the current session" + onPressed: lock.locked = true + } + + CustomShortcut { + name: "unlock" + description: "Unlock the current session" + onPressed: lock.locked = false + } + + IpcHandler { + target: "lock" + + function lock(): void { + lock.locked = true; + } + } +} |