mirror of
https://github.com/starship/starship.git
synced 2025-02-23 22:01:08 +01:00
Allow customization of notification timeout
This commit is contained in:
parent
bf55a9478a
commit
92bca205e7
@ -12,6 +12,7 @@ pub struct CmdDurationConfig<'a> {
|
||||
pub disabled: bool,
|
||||
pub show_notifications: bool,
|
||||
pub min_time_to_notify: i64,
|
||||
pub notification_timeout: u64,
|
||||
}
|
||||
|
||||
impl<'a> Default for CmdDurationConfig<'a> {
|
||||
@ -24,6 +25,7 @@ impl<'a> Default for CmdDurationConfig<'a> {
|
||||
disabled: false,
|
||||
show_notifications: false,
|
||||
min_time_to_notify: 45_000,
|
||||
notification_timeout: 750,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ fn undistract_me<'a, 'b>(
|
||||
.summary("Command finished")
|
||||
.body(&body)
|
||||
.icon("utilities-terminal")
|
||||
.timeout(Timeout::Milliseconds(750));
|
||||
.timeout(Timeout::Milliseconds(config.notification_timeout as u32));
|
||||
|
||||
if let Err(err) = notification.show() {
|
||||
log::trace!("Cannot show notification: {}", err);
|
||||
|
Loading…
Reference in New Issue
Block a user