1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-07 11:00:47 +00:00
starship/src/configs/cmd_duration.rs
Marc Schreiber 8c71eb5307
feat: Add Undistract Me Feature (#1019)
Often it is handy to get notified when the execution of a command finished.
This commit includes notify-rust in order to generate a desktop notification
when a command execution finished.
2020-08-11 18:44:25 +02:00

29 lines
754 B
Rust

use crate::config::{ModuleConfig, RootModuleConfig};
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig)]
pub struct CmdDurationConfig<'a> {
pub min_time: i64,
pub format: &'a str,
pub style: &'a str,
pub show_milliseconds: bool,
pub disabled: bool,
pub show_notifications: bool,
pub min_time_to_notify: i64,
}
impl<'a> RootModuleConfig<'a> for CmdDurationConfig<'a> {
fn new() -> Self {
CmdDurationConfig {
min_time: 2_000,
format: "took [$duration]($style) ",
show_milliseconds: false,
style: "yellow bold",
disabled: false,
show_notifications: false,
min_time_to_notify: 45_000,
}
}
}