lock: use direct Scope instead of LazyLoader, gate on module enable

This commit is contained in:
Damocles 2026-04-17 13:53:49 +02:00
parent fcbb54949f
commit fec5ef4d76
2 changed files with 5 additions and 6 deletions

View file

@ -7,6 +7,8 @@ import ".." as M
Scope { Scope {
id: root id: root
readonly property bool _enabled: M.Modules.lock.enable
WlSessionLock { WlSessionLock {
id: lock id: lock
@ -26,13 +28,13 @@ Scope {
Process { Process {
id: _logindMonitor id: _logindMonitor
command: ["busctl", "monitor", "--system", "--match", "type='signal',interface='org.freedesktop.login1.Session',member='Lock'", "--match", "type='signal',interface='org.freedesktop.login1.Session',member='Unlock'", "--json=short"] command: ["busctl", "monitor", "--system", "--match", "type='signal',interface='org.freedesktop.login1.Session',member='Lock'", "--match", "type='signal',interface='org.freedesktop.login1.Session',member='Unlock'", "--json=short"]
running: true running: root._enabled
stdout: SplitParser { stdout: SplitParser {
onRead: data => { onRead: data => {
try { try {
const msg = JSON.parse(data); const msg = JSON.parse(data);
if (msg.member === "Lock") if (msg.member === "Lock" && root._enabled)
lock.locked = true; lock.locked = true;
// Unlock is PAM-driven, ignore logind Unlock signal // Unlock is PAM-driven, ignore logind Unlock signal
} catch (e) {} } catch (e) {}

View file

@ -5,10 +5,7 @@ import "modules/lock" as Lock
import Quickshell import Quickshell
ShellRoot { ShellRoot {
LazyLoader {
active: Modules.lock.enable
Lock.Lock {} Lock.Lock {}
}
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens