Read all CPUs in one widget.

This commit is contained in:
2019-09-26 21:57:42 -07:00
parent a1cdec0a24
commit 10c7dcdeab
3 changed files with 75 additions and 140 deletions

View File

@@ -2,8 +2,6 @@ use chrono::NaiveTime;
use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
use num_cpus;
use structopt::StructOpt;
use i3xs::widgets::cpu::CpuWidget;
@@ -22,10 +20,7 @@ fn main() {
let opts = Opt::from_args();
// Display all the cpu usage for each core
for i in 0..num_cpus::get() as u32 {
bar.push(CpuWidget::new(i));
}
bar.push(CpuWidget::new());
// Realtime upload/download rate for a interface
bar.push(NetworkSpeedWidget::new(&opts.nic, 6));

View File

@@ -2,8 +2,6 @@ use chrono::NaiveTime;
use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
use num_cpus;
use structopt::StructOpt;
use i3xs::widgets::cpu::CpuWidget;
@@ -22,10 +20,7 @@ fn main() {
let opts = Opt::from_args();
// Display all the cpu usage for each core
for i in 0..num_cpus::get() as u32 {
bar.push(CpuWidget::new(i));
}
bar.push(CpuWidget::new());
// Realtime upload/download rate for a interface
bar.push(NetworkSpeedWidget::new(&opts.nic, 6));