mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
feat: implement uwsm session check on logout
This commit is contained in:
@@ -187,10 +187,33 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
if (isNiri) {
|
// Trigger the check process
|
||||||
NiriService.quit()
|
uwsmCheck.running = true
|
||||||
return
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: uwsmCheck
|
||||||
|
// `uwsm check is-active` returns 0 if in uwsm-managed session, 1 otherwise
|
||||||
|
command: ["uwsm", "check", "is-active"]
|
||||||
|
running: false
|
||||||
|
onExited: function(exitCode) {
|
||||||
|
if (exitCode === 0) {
|
||||||
|
uwsmStop.running = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not a uwsm-managed session; fall back to compositor-specific logout
|
||||||
|
if (isNiri) {
|
||||||
|
NiriService.quit()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Hyprland.dispatch("exit")
|
||||||
}
|
}
|
||||||
Hyprland.dispatch("exit")
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: uwsmStop
|
||||||
|
command: ["uwsm", "stop"]
|
||||||
|
running: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user