2019-10-20 15:26:04 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig, SegmentConfig};
|
|
|
|
|
|
|
|
use ansi_term::{Color, Style};
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
|
|
pub struct MemoryConfig<'a> {
|
|
|
|
pub show_percentage: bool,
|
|
|
|
pub show_swap: bool,
|
|
|
|
pub threshold: i64,
|
|
|
|
pub symbol: SegmentConfig<'a>,
|
2019-11-13 01:57:46 +00:00
|
|
|
pub separator: SegmentConfig<'a>,
|
|
|
|
pub ram: SegmentConfig<'a>,
|
|
|
|
pub swap: SegmentConfig<'a>,
|
2019-10-20 15:26:04 +00:00
|
|
|
pub style: Style,
|
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> RootModuleConfig<'a> for MemoryConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
MemoryConfig {
|
|
|
|
show_percentage: false,
|
|
|
|
show_swap: true,
|
|
|
|
threshold: 75,
|
|
|
|
symbol: SegmentConfig::new("🐏 "),
|
2019-11-13 01:57:46 +00:00
|
|
|
separator: SegmentConfig::new(" | "),
|
|
|
|
ram: SegmentConfig::default(),
|
|
|
|
swap: SegmentConfig::default(),
|
2019-10-20 15:26:04 +00:00
|
|
|
style: Color::White.bold().dimmed(),
|
|
|
|
disabled: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|