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 {
|
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) {}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,7 @@ import "modules/lock" as Lock
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
LazyLoader {
|
Lock.Lock {}
|
||||||
active: Modules.lock.enable
|
|
||||||
Lock.Lock {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue