lock: use direct Scope instead of LazyLoader, gate on module enable
This commit is contained in:
parent
fcbb54949f
commit
fec5ef4d76
2 changed files with 5 additions and 6 deletions
|
|
@ -7,6 +7,8 @@ import ".." as M
|
|||
Scope {
|
||||
id: root
|
||||
|
||||
readonly property bool _enabled: M.Modules.lock.enable
|
||||
|
||||
WlSessionLock {
|
||||
id: lock
|
||||
|
||||
|
|
@ -26,13 +28,13 @@ Scope {
|
|||
Process {
|
||||
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"]
|
||||
running: true
|
||||
running: root._enabled
|
||||
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
try {
|
||||
const msg = JSON.parse(data);
|
||||
if (msg.member === "Lock")
|
||||
if (msg.member === "Lock" && root._enabled)
|
||||
lock.locked = true;
|
||||
// Unlock is PAM-driven, ignore logind Unlock signal
|
||||
} catch (e) {}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@ import "modules/lock" as Lock
|
|||
import Quickshell
|
||||
|
||||
ShellRoot {
|
||||
LazyLoader {
|
||||
active: Modules.lock.enable
|
||||
Lock.Lock {}
|
||||
}
|
||||
Lock.Lock {}
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue