diff --git a/src/widgets/power.rs b/src/widgets/power.rs index 999ecd5..334bbc1 100644 --- a/src/widgets/power.rs +++ b/src/widgets/power.rs @@ -58,6 +58,14 @@ impl PowerSupply { }) }) .collect::>()?; + // 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 .get("POWER_SUPPLY_CAPACITY") .unwrap_or(&"0")