forked from wathiede/i3xs
Set colors for clock in work profile.
This commit is contained in:
parent
4cb50597e1
commit
14b58f766a
@ -1,4 +1,5 @@
|
|||||||
use chrono::NaiveTime;
|
use chrono::NaiveTime;
|
||||||
|
|
||||||
use i3monkit::widgets::CpuWidget;
|
use i3monkit::widgets::CpuWidget;
|
||||||
use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
|
use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
|
use chrono::NaiveTime;
|
||||||
|
|
||||||
use i3monkit::widgets::CpuWidget;
|
use i3monkit::widgets::CpuWidget;
|
||||||
use i3monkit::{Header, I3Protocol, WidgetCollection};
|
use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
|
||||||
|
|
||||||
use num_cpus;
|
use num_cpus;
|
||||||
|
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
|
||||||
use i3xs::widgets::datetime::DateTimeWidget;
|
use i3xs::widgets::datetime::{DateTimeWidget, TimeColor};
|
||||||
use i3xs::widgets::network::NetworkSpeedWidget;
|
use i3xs::widgets::network::NetworkSpeedWidget;
|
||||||
|
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
@ -32,7 +34,18 @@ fn main() {
|
|||||||
"%H:%M %Z".to_string(),
|
"%H:%M %Z".to_string(),
|
||||||
"Europe/London".to_string(),
|
"Europe/London".to_string(),
|
||||||
));
|
));
|
||||||
bar.push(DateTimeWidget::new("%m/%d %H:%M".to_string()));
|
let mut dt = DateTimeWidget::new("%m/%d %H:%M".to_string());
|
||||||
|
dt.set_colors(&vec![
|
||||||
|
TimeColor {
|
||||||
|
start: NaiveTime::from_hms(13, 0, 0),
|
||||||
|
color: ColorRGB::yellow(),
|
||||||
|
},
|
||||||
|
TimeColor {
|
||||||
|
start: NaiveTime::from_hms(14, 0, 0),
|
||||||
|
color: ColorRGB::red(),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
bar.push(dt);
|
||||||
|
|
||||||
// Then start updating the status bar
|
// Then start updating the status bar
|
||||||
bar.update_loop(I3Protocol::new(Header::new(1), std::io::stdout()));
|
bar.update_loop(I3Protocol::new(Header::new(1), std::io::stdout()));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user