diff --git a/src/widgets/cpu.rs b/src/widgets/cpu.rs index 5aafc01..6b6ec82 100644 --- a/src/widgets/cpu.rs +++ b/src/widgets/cpu.rs @@ -64,7 +64,7 @@ impl CpuWidget { pub fn new() -> Self { let last_stats = Self::read_status().unwrap(); - let num_samples = 6; + let num_samples = 1; let history = (0..last_stats.len()) .map(|_| (0..num_samples).map(|_| 0.).collect::>()) .collect::>>(); @@ -116,7 +116,8 @@ impl CpuWidget { .collect() }) .collect(); - Some(format!("CPU|{}", graphs.join("|"))) + let joiner = if self.history[0].len() > 1 { "|" } else { "" }; + Some(format!("CPU|{}", graphs.join(joiner))) } }