mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
Merge pull request #121 from Vantesh/master
Add UWSM session check to prefer uwsm stop over compositor exit
This commit is contained in:
@@ -13,6 +13,7 @@ Singleton {
|
|||||||
// Compositor detection
|
// Compositor detection
|
||||||
property bool isHyprland: false
|
property bool isHyprland: false
|
||||||
property bool isNiri: false
|
property bool isNiri: false
|
||||||
|
property bool uwsmActive: false
|
||||||
property string compositor: "unknown"
|
property string compositor: "unknown"
|
||||||
|
|
||||||
readonly property string hyprlandSignature: Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE")
|
readonly property string hyprlandSignature: Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE")
|
||||||
@@ -80,6 +81,7 @@ Singleton {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
detectCompositor()
|
detectCompositor()
|
||||||
|
uwsmCheck.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterCurrentWorkspace(toplevels, screen){
|
function filterCurrentWorkspace(toplevels, screen){
|
||||||
@@ -187,10 +189,27 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
|
if (uwsmActive) {
|
||||||
|
Quickshell.execDetached(["uwsm", "stop"])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (isNiri) {
|
if (isNiri) {
|
||||||
NiriService.quit()
|
NiriService.quit()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hyprland fallback
|
||||||
Hyprland.dispatch("exit")
|
Hyprland.dispatch("exit")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
uwsmActive = exitCode === 0
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user