diff --git a/src/main.rs b/src/main.rs index 0d16b617..e05a597e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,7 +88,7 @@ fn run() -> Result<()> { #[cfg(target_os = "linux")] { - if config.display_preamble() && !config.skip_notify() { + if config.display_preamble() && terminal::supports_notify_send() && !config.skip_notify() { print_warning("Due to a design issue with notify-send it could be that topgrade hangs when it's finished. If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file. If you don't want this message to appear any longer set display_preamble = false in the config file. diff --git a/src/terminal.rs b/src/terminal.rs index 6bd84678..20f95e79 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -345,3 +345,8 @@ pub fn notify_desktop>(message: P, timeout: Option) { pub fn display_time(display_time: bool) { TERMINAL.lock().unwrap().display_time(display_time); } + +#[cfg(target_os = "linux")] +pub fn supports_notify_send() -> bool { + TERMINAL.lock().unwrap().notify_send.is_some() +}