Skip to content

Commit

Permalink
Fallback when XDG_CURRENT_DESKTOP & XDG_SESSION_TYPE is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhyub committed Jan 8, 2024
1 parent edd690c commit 7bafe3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools/check/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ impl Check {
"set LANG encoding UTF-8",
),
Check::PlasmaVirtualKeyboard => {
let current_desktop = env::var("XDG_CURRENT_DESKTOP").unwrap();
let session_type = env::var("XDG_SESSION_TYPE").unwrap();
let current_desktop = env::var("XDG_CURRENT_DESKTOP").map_or(String::new(), |x| x);
let session_type = env::var("XDG_SESSION_TYPE").map_or(String::new(), |x| x);
if current_desktop.contains("KDE") && session_type == "wayland" {
let dirs = xdg::BaseDirectories::new().expect("Load xdg dirs");
let config_path = match dirs.find_config_file("kwinrc") {
Expand Down

0 comments on commit 7bafe3f

Please sign in to comment.