1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

fix loginctl monitoring

This commit is contained in:
bbedward
2025-08-12 23:53:07 -04:00
parent bbd23171cc
commit 3bbf8c5844

View File

@@ -71,22 +71,24 @@ Item {
command: root.sessionPath ? ["gdbus", "monitor", "--system", "--dest", "org.freedesktop.login1", "--object-path", root.sessionPath] : []
running: false
stdout: StdioCollector {
onRead: (chunk) => {
if (chunk.includes("LockedHint") && chunk.includes("true")) {
stdout: SplitParser {
splitMarker: "\n"
onRead: (line) => {
if (line.includes("org.freedesktop.login1.Session.Lock")) {
console.log("login1: Lock signal received -> show lock")
loader.activeAsync = true
} else if (line.includes("org.freedesktop.login1.Session.Unlock")) {
console.log("login1: Unlock signal received -> hide lock")
loader.active = false
} else if (line.includes("LockedHint") && line.includes("true")) {
console.log("login1: LockedHint=true -> show lock")
loader.activeAsync = true
} else if (chunk.includes("LockedHint") && chunk.includes("false")) {
} else if (line.includes("LockedHint") && line.includes("false")) {
console.log("login1: LockedHint=false -> hide lock")
loader.active = false
}
}
onStreamFinished: {
console.warn("gdbus monitor ended, restarting...")
Qt.callLater(() => {
if (root.sessionPath) lockStateMonitor.running = true
})
}
}
onExited: (exitCode, exitStatus) => {