Minimal i3 status app.
This commit is contained in:
28
src/main.rs
Normal file
28
src/main.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use i3monkit::widgets::*;
|
||||
use i3monkit::*;
|
||||
|
||||
use num_cpus;
|
||||
|
||||
fn main() {
|
||||
let mut bar = WidgetCollection::new();
|
||||
|
||||
//Realtime upload/download rate for a interface
|
||||
bar.push(NetworkSpeedWidget::new("eth0"));
|
||||
|
||||
//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());
|
||||
|
||||
// Then start updating the satus bar
|
||||
bar.update_loop(I3Protocol::new(Header::new(1), std::io::stdout()));
|
||||
}
|
||||
Reference in New Issue
Block a user