hotfix: make WM fetching more cross-platform capable
This commit is contained in:
parent
5d0ab4974e
commit
3367dcd576
1 changed files with 7 additions and 1 deletions
|
@ -47,7 +47,13 @@ fn main() {
|
||||||
if cfg!(windows) {
|
if cfg!(windows) {
|
||||||
wm = "Aero".to_string();
|
wm = "Aero".to_string();
|
||||||
} else if cfg!(unix) {
|
} else if cfg!(unix) {
|
||||||
wm = var("XDG_CURRENT_DESKTOP").unwrap();
|
let xdg_current_desktop = var("XDG_CURRENT_DESKTOP");
|
||||||
|
let desktop = desktop_env().to_string();
|
||||||
|
if !xdg_current_desktop.is_err() && (desktop != "Unknown: Unknown") {
|
||||||
|
wm = desktop;
|
||||||
|
} else {
|
||||||
|
wm = xdg_current_desktop.unwrap();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
wm = "N/A".to_string();
|
wm = "N/A".to_string();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue