Remove broken widgets and allow NIC to be set with flag.
This commit is contained in:
21
src/main.rs
21
src/main.rs
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user