From c0b3e9ee35709c8475e0e13b45be153106765371 Mon Sep 17 00:00:00 2001 From: Frederic Grabowski Date: Sat, 12 Nov 2022 22:39:53 +0100 Subject: [PATCH] normalize capacity by number of batteries --- src/modules/battery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 5576054..0ddd824 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -495,7 +495,7 @@ const std::tuple waybar::modules::Battery::g float calculated_capacity{0.0f}; if (total_capacity_exists) { if (total_capacity > 0.0f) - calculated_capacity = (float)total_capacity; + calculated_capacity = (float)total_capacity / batteries_.size(); else if (total_energy_full_exists && total_energy_exists) { if (total_energy_full > 0.0f) calculated_capacity = ((float)total_energy * 100.0f / (float)total_energy_full);