forked from wathiede/i3xs
Only show power levels for battery powered things
This commit is contained in:
parent
b9935c991f
commit
b124148b0b
@ -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