2022-03-26 09:42:19 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2019-10-20 15:26:04 +00:00
|
|
|
|
2022-03-26 09:42:19 +00:00
|
|
|
#[derive(Clone, Deserialize, Serialize)]
|
2022-09-09 12:59:38 +00:00
|
|
|
#[cfg_attr(
|
|
|
|
feature = "config-schema",
|
|
|
|
derive(schemars::JsonSchema),
|
|
|
|
schemars(deny_unknown_fields)
|
|
|
|
)]
|
2022-03-26 09:42:19 +00:00
|
|
|
#[serde(default)]
|
2019-10-20 15:26:04 +00:00
|
|
|
pub struct MemoryConfig<'a> {
|
|
|
|
pub threshold: i64,
|
2020-07-07 22:45:32 +00:00
|
|
|
pub format: &'a str,
|
|
|
|
pub style: &'a str,
|
|
|
|
pub symbol: &'a str,
|
2019-10-20 15:26:04 +00:00
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for MemoryConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2019-10-20 15:26:04 +00:00
|
|
|
MemoryConfig {
|
|
|
|
threshold: 75,
|
2020-07-07 22:45:32 +00:00
|
|
|
format: "via $symbol[$ram( | $swap)]($style) ",
|
|
|
|
style: "white bold dimmed",
|
|
|
|
symbol: "🐏 ",
|
2019-10-20 15:26:04 +00:00
|
|
|
disabled: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|