Replace NetworkSpeedWidget with new AllNetworkSpeedWidget.

This commit is contained in:
Bill Thiede 2023-07-30 13:32:35 -07:00
parent 44c0c21018
commit 2bce347cd5
2 changed files with 8 additions and 14 deletions

View File

@ -3,28 +3,25 @@ use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
use i3xs::widgets::{
cpu::CpuWidget,
datetime::{DateTimeWidget, TimeColor},
network::NetworkSpeedWidget,
network::AllNetworkSpeedWidget,
power::PowerSupply,
};
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "i3xs", about = "Custom i3 status bar program.")]
struct Opt {
#[structopt(short, long)]
nic: String,
}
struct Opt {}
fn main() {
let mut bar = WidgetCollection::new();
let opts = Opt::from_args();
let _opts = Opt::from_args();
bar.push(PowerSupply::default());
bar.push(CpuWidget::default());
// Realtime upload/download rate for a interface
bar.push(NetworkSpeedWidget::new(&opts.nic, 6));
bar.push(AllNetworkSpeedWidget::new(6));
let mut dt = DateTimeWidget::new("%m/%d %H:%M");
dt.set_colors(vec![

View File

@ -3,28 +3,25 @@ use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
use i3xs::widgets::{
cpu::CpuWidget,
datetime::{DateTimeWidget, TimeColor},
network::NetworkSpeedWidget,
network::AllNetworkSpeedWidget,
power::PowerSupply,
};
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "i3xs", about = "Custom i3 status bar program.")]
struct Opt {
#[structopt(short, long)]
nic: String,
}
struct Opt {}
fn main() {
let mut bar = WidgetCollection::new();
let opts = Opt::from_args();
let _opts = Opt::from_args();
bar.push(PowerSupply::default());
bar.push(CpuWidget::default());
// Realtime upload/download rate for a interface
bar.push(NetworkSpeedWidget::new(&opts.nic, 6));
bar.push(AllNetworkSpeedWidget::new(6));
let mut dt = DateTimeWidget::tz("%H:%M %Z", chrono_tz::Europe::London);
dt.set_colors(vec![