Skip to content

Commit

Permalink
monitors: add tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Jun 4, 2024
1 parent 3318734 commit f80fc46
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions monitors/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ use re_set_lib::ERROR;
#[cfg(debug_assertions)]
use re_set_lib::{utils::macros::ErrorLevel, write_log_to_file};

pub static ENV: Lazy<String> = Lazy::new(|| {
get_environment()
});
pub static ENV: Lazy<String> = Lazy::new(get_environment);
pub const GNOME: &str = "GNOME";

pub fn get_environment() -> String {
let desktop = std::env::var("XDG_CURRENT_DESKTOP");
if desktop.is_err() {
return "NONE".into();
}
desktop.unwrap()
let desktop = desktop.unwrap();
let split = desktop.split_once(':');
if split.is_none() {
return desktop;
}
split.unwrap().1.to_string()
}

pub fn check_environment_support() -> bool {
Expand Down

0 comments on commit f80fc46

Please sign in to comment.