Compare commits
2 Commits
b9935c991f
...
4fcbf23210
| Author | SHA1 | Date | |
|---|---|---|---|
| 4fcbf23210 | |||
| b124148b0b |
@ -1,5 +1,5 @@
|
|||||||
use chrono::NaiveTime;
|
use chrono::NaiveTime;
|
||||||
use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
|
use i3monkit::{widgets::VolumeWidget, ColorRGB, Header, I3Protocol, WidgetCollection};
|
||||||
use i3xs::widgets::{
|
use i3xs::widgets::{
|
||||||
cpu::CpuWidget,
|
cpu::CpuWidget,
|
||||||
datetime::{DateTimeWidget, TimeColor},
|
datetime::{DateTimeWidget, TimeColor},
|
||||||
@ -27,6 +27,8 @@ fn main() {
|
|||||||
// Realtime read/write rate for a any active disks
|
// Realtime read/write rate for a any active disks
|
||||||
bar.push(AllDiskSpeedWidget::new(6));
|
bar.push(AllDiskSpeedWidget::new(6));
|
||||||
|
|
||||||
|
bar.push(VolumeWidget::new("default", "Master", 0));
|
||||||
|
|
||||||
let mut dt = DateTimeWidget::new("%m/%d %H:%M");
|
let mut dt = DateTimeWidget::new("%m/%d %H:%M");
|
||||||
dt.set_colors(vec![
|
dt.set_colors(vec![
|
||||||
TimeColor {
|
TimeColor {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
use chrono::NaiveTime;
|
use chrono::NaiveTime;
|
||||||
use i3monkit::{ColorRGB, Header, I3Protocol, WidgetCollection};
|
use i3monkit::{widgets::VolumeWidget, ColorRGB, Header, I3Protocol, WidgetCollection};
|
||||||
use i3xs::widgets::{
|
use i3xs::widgets::{
|
||||||
cpu::CpuWidget,
|
cpu::CpuWidget,
|
||||||
datetime::{DateTimeWidget, TimeColor},
|
datetime::{DateTimeWidget, TimeColor},
|
||||||
@ -27,6 +27,8 @@ fn main() {
|
|||||||
// Realtime read/write rate for a any active disks
|
// Realtime read/write rate for a any active disks
|
||||||
bar.push(AllDiskSpeedWidget::new(6));
|
bar.push(AllDiskSpeedWidget::new(6));
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Setup time in London widget with end of day warnings
|
||||||
let mut dt = DateTimeWidget::tz("%H:%M %Z", chrono_tz::Europe::London);
|
let mut dt = DateTimeWidget::tz("%H:%M %Z", chrono_tz::Europe::London);
|
||||||
dt.set_colors(vec![
|
dt.set_colors(vec![
|
||||||
TimeColor {
|
TimeColor {
|
||||||
@ -47,6 +49,9 @@ fn main() {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
bar.push(dt);
|
bar.push(dt);
|
||||||
|
*/
|
||||||
|
|
||||||
|
bar.push(VolumeWidget::new("default", "Master", 0));
|
||||||
|
|
||||||
let mut dt = DateTimeWidget::new("%m/%d %H:%M");
|
let mut dt = DateTimeWidget::new("%m/%d %H:%M");
|
||||||
dt.set_colors(vec![
|
dt.set_colors(vec![
|
||||||
|
|||||||
@ -58,6 +58,14 @@ impl PowerSupply {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect::<Result<_, _>>()?;
|
.collect::<Result<_, _>>()?;
|
||||||
|
// Skip things that aren't battery powered
|
||||||
|
if !values
|
||||||
|
.get("POWER_SUPPLY_TYPE")
|
||||||
|
.map(|t| t == &"Battery")
|
||||||
|
.unwrap_or(false)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let cap: u32 = values
|
let cap: u32 = values
|
||||||
.get("POWER_SUPPLY_CAPACITY")
|
.get("POWER_SUPPLY_CAPACITY")
|
||||||
.unwrap_or(&"0")
|
.unwrap_or(&"0")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user