From 8ce557cf24e81c6e3094b4ad66e8bb09ae67e713 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Sun, 24 Mar 2024 20:40:30 +0000 Subject: [PATCH] hotfix: add more resiliency to WM --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b811ea6..668b33c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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();