mirror of
https://github.com/belsabbagh/dotfiles.git
synced 2026-04-11 09:36:46 +00:00
quickshell and hyprland additions
This commit is contained in:
55
.config/quickshell/caelestia/modules/lock/Lock.qml
Normal file
55
.config/quickshell/caelestia/modules/lock/Lock.qml
Normal file
@@ -0,0 +1,55 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.components.misc
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
|
||||
Scope {
|
||||
property alias lock: lock
|
||||
|
||||
WlSessionLock {
|
||||
id: lock
|
||||
|
||||
signal unlock
|
||||
|
||||
LockSurface {
|
||||
lock: lock
|
||||
pam: pam
|
||||
}
|
||||
}
|
||||
|
||||
Pam {
|
||||
id: pam
|
||||
|
||||
lock: lock
|
||||
}
|
||||
|
||||
CustomShortcut {
|
||||
name: "lock"
|
||||
description: "Lock the current session"
|
||||
onPressed: lock.locked = true
|
||||
}
|
||||
|
||||
CustomShortcut {
|
||||
name: "unlock"
|
||||
description: "Unlock the current session"
|
||||
onPressed: lock.unlock()
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "lock"
|
||||
|
||||
function lock(): void {
|
||||
lock.locked = true;
|
||||
}
|
||||
|
||||
function unlock(): void {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
function isLocked(): bool {
|
||||
return lock.locked;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user