mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Show battery state as rounded number
Round the battery charge state so that 99.9% shows as 100%.
This commit is contained in:
parent
e0cdcb6e30
commit
eb3f4216d4
@ -138,7 +138,7 @@ const std::tuple<uint8_t, float, std::string> waybar::modules::Battery::getInfos
|
|||||||
capacity = 100.f;
|
capacity = 100.f;
|
||||||
status = "Full";
|
status = "Full";
|
||||||
}
|
}
|
||||||
return {capacity, time_remaining, status};
|
return {round(capacity), time_remaining, status};
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
spdlog::error("Battery: {}", e.what());
|
spdlog::error("Battery: {}", e.what());
|
||||||
return {0, 0, "Unknown"};
|
return {0, 0, "Unknown"};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user