fix i3status appening comma to battery charge

This commit is contained in:
LordMZTE 2021-08-12 13:15:28 +02:00
parent c2d9695ec7
commit dc8de7e3a8

View file

@ -125,7 +125,7 @@ pub(crate) async fn battery(bar: Arc<RwLock<Bar>>) {
let txt; let txt;
if let Some(s) = out { if let Some(s) = out {
if let Some(bat) = s.lines().next() { if let Some(bat) = s.lines().next() {
let percent = bat.split(' ').find(|s| s.contains('%')).unwrap_or("0%"); let percent = bat.split(&[' ', ','][..]).find(|s| s.contains('%')).unwrap_or("0%");
let state = if bat.contains("Charging") { let state = if bat.contains("Charging") {
BatteryState::Charging BatteryState::Charging
} else if bat.contains("Discharging") { } else if bat.contains("Discharging") {