2021-03-15 10:40:52 +00:00
|
|
|
use crate::config::ModuleConfig;
|
2020-09-25 22:04:51 +00:00
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
use serde::Serialize;
|
2020-09-25 22:04:51 +00:00
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
#[derive(Clone, ModuleConfig, Serialize)]
|
2020-09-25 22:04:51 +00:00
|
|
|
pub struct StatusConfig<'a> {
|
|
|
|
pub format: &'a str,
|
|
|
|
pub symbol: &'a str,
|
2021-07-28 16:26:00 +00:00
|
|
|
pub success_symbol: &'a str,
|
2021-01-03 03:09:13 +00:00
|
|
|
pub not_executable_symbol: &'a str,
|
|
|
|
pub not_found_symbol: &'a str,
|
|
|
|
pub sigint_symbol: &'a str,
|
|
|
|
pub signal_symbol: &'a str,
|
2020-09-25 22:04:51 +00:00
|
|
|
pub style: &'a str,
|
2021-01-03 03:09:13 +00:00
|
|
|
pub map_symbol: bool,
|
|
|
|
pub recognize_signal_code: bool,
|
2021-07-28 16:26:00 +00:00
|
|
|
pub pipestatus: bool,
|
|
|
|
pub pipestatus_separator: &'a str,
|
|
|
|
pub pipestatus_format: &'a str,
|
2020-09-25 22:04:51 +00:00
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for StatusConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2020-09-25 22:04:51 +00:00
|
|
|
StatusConfig {
|
|
|
|
format: "[$symbol$status]($style) ",
|
|
|
|
symbol: "✖",
|
2021-07-28 16:26:00 +00:00
|
|
|
success_symbol: "✔️",
|
2021-01-03 03:09:13 +00:00
|
|
|
not_executable_symbol: "🚫",
|
|
|
|
not_found_symbol: "🔍",
|
|
|
|
sigint_symbol: "🧱",
|
|
|
|
signal_symbol: "⚡",
|
2020-09-25 22:04:51 +00:00
|
|
|
style: "bold red",
|
2021-01-03 03:09:13 +00:00
|
|
|
map_symbol: false,
|
|
|
|
recognize_signal_code: true,
|
2021-07-28 16:26:00 +00:00
|
|
|
pipestatus: false,
|
|
|
|
pipestatus_separator: "|",
|
|
|
|
pipestatus_format:
|
|
|
|
"\\[$pipestatus\\] => [$symbol$common_meaning$signal_name$maybe_int]($style)",
|
2020-09-25 22:04:51 +00:00
|
|
|
disabled: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|