Display the preamble in Linux only if notify-send is installed (#401)
This commit is contained in:
committed by
GitHub
parent
565aa405be
commit
ddb1a021bb
@@ -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.
|
||||
|
||||
@@ -345,3 +345,8 @@ pub fn notify_desktop<P: AsRef<str>>(message: P, timeout: Option<Duration>) {
|
||||
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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user