Skip to content

Instantly share code, notes, and snippets.

@dogamak
Created June 27, 2017 10:39
Show Gist options
  • Save dogamak/05eb8063c952b8400f13d6fb3efe7336 to your computer and use it in GitHub Desktop.
Save dogamak/05eb8063c952b8400f13d6fb3efe7336 to your computer and use it in GitHub Desktop.
My xcbars
extern crate xcbars;
use xcbars::{
BarBuilder,
Color,
Slot,
Position,
Geometry,
};
use xcbars::components::{
Pipe,
Text,
NetworkUsage,
};
use std::time::Duration;
fn main() {
BarBuilder::new()
.geometry(Geometry::Relative {
position: Position::Top,
height: 30,
padding_x: 75,
padding_y: 0,
})
.background(Color::new(241./255., 216./255., 193./255.))
.foreground(Color::new( 43./255., 135./255., 154./255.))
.font("Inconsolata 13")
.add_component(Slot::Left, Pipe {
command: "/home/dogamak/.dotfiles/bin/weechat_hotlist_bar.py"
.to_string(),
.. Default::default()
})
.add_component(Slot::Center, Pipe {
command: "date".to_string(),
args: vec!["+%H:%M:%S".to_string()],
refresh_rate: Some(Duration::from_secs(1)),
})
.add_component(Slot::Right, Text {
text: "Down: ".to_string()
})
.add_component(Slot::Right, NetworkUsage {
interface: "wlp58s0".to_string(),
.. Default::default()
})
.run().unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment