diff --git a/config.example.toml b/config.example.toml index 7055bd02..8e8ce5cf 100644 --- a/config.example.toml +++ b/config.example.toml @@ -44,6 +44,9 @@ # Skip sending a notification at the end of a run #skip_notify = true +# Skip the preamble displayed when topgrade is run +#display_preamble = false + [git] #max_concurrency = 5 # Additional git repositories to pull diff --git a/src/config.rs b/src/config.rs index 590f8544..d39d4c7d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -294,6 +294,7 @@ pub struct ConfigFile { tmux_arguments: Option, set_title: Option, display_time: Option, + display_preambe: Option, assume_yes: Option, yay_arguments: Option, aura_aur_arguments: Option, @@ -1050,6 +1051,10 @@ impl Config { self.config_file.display_time.unwrap_or(true) } + pub fn display_preamble(&self) -> bool { + self.config_file.display_preambe.unwrap_or(true) + } + pub fn should_run_custom_command(&self, name: &str) -> bool { if self.opt.custom_commands.is_empty() { return true; diff --git a/src/main.rs b/src/main.rs index 9db00fbb..a5603b35 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,6 +86,13 @@ fn run() -> Result<()> { debug!("Binary path: {:?}", std::env::current_exe()); debug!("Self Update: {:?}", cfg!(feature = "self-update")); + if config.display_preamble() { + print_warning(format!("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. +For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288.")); + } + if config.run_in_tmux() && env::var("TOPGRADE_INSIDE_TMUX").is_err() { #[cfg(unix)] {