hotfix: add more resiliency to WM

This commit is contained in:
Muhammad Nauman Raza 2024-03-24 20:40:30 +00:00
parent 415139d207
commit 8ce557cf24
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -49,10 +49,12 @@ fn main() {
} else if cfg!(unix) {
let xdg_current_desktop = var("XDG_CURRENT_DESKTOP");
let desktop = desktop_env().to_string();
if !xdg_current_desktop.is_err() && (desktop != "Unknown: Unknown") {
if desktop != "Unknown: Unknown" {
wm = desktop;
} else {
} else if !xdg_current_desktop.is_err() {
wm = xdg_current_desktop.unwrap();
} else {
wm = "N/A".to_string();
}
} else {
wm = "N/A".to_string();