1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-30 00:12:50 -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] : [] command: root.sessionPath ? ["gdbus", "monitor", "--system", "--dest", "org.freedesktop.login1", "--object-path", root.sessionPath] : []
running: false running: false
stdout: StdioCollector { stdout: SplitParser {
onRead: (chunk) => { splitMarker: "\n"
if (chunk.includes("LockedHint") && chunk.includes("true")) {
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") console.log("login1: LockedHint=true -> show lock")
loader.activeAsync = true 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") console.log("login1: LockedHint=false -> hide lock")
loader.active = false loader.active = false
} }
} }
onStreamFinished: {
console.warn("gdbus monitor ended, restarting...")
Qt.callLater(() => {
if (root.sessionPath) lockStateMonitor.running = true
})
}
} }
onExited: (exitCode, exitStatus) => { onExited: (exitCode, exitStatus) => {