Remove broken widgets and allow NIC to be set with flag.

This commit is contained in:
2019-09-21 11:32:14 -07:00
parent 5d509faff3
commit fd4d85a561
3 changed files with 120 additions and 8 deletions

View File

@@ -3,23 +3,28 @@ use i3monkit::*;
use num_cpus;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name="i3xs", about="Custom i3 status bar program.")]
struct Opt {
#[structopt(short, long)]
nic: String,
}
fn main() {
let mut bar = WidgetCollection::new();
//Realtime upload/download rate for a interface
bar.push(NetworkSpeedWidget::new("eth0"));
let opts=Opt::from_args();
// Realtime upload/download rate for a interface
bar.push(NetworkSpeedWidget::new(&opts.nic));
//Display all the cpu usage for each core
for i in 0..num_cpus::get() as u32 {
bar.push(CpuWidget::new(i));
}
//Volume widget
bar.push(VolumeWidget::new("default", "Master", 0));
//Battery status
bar.push(BatteryWidget::new(0));
//Time
bar.push(DateTimeWidget::new());