feat(battery): Also support energy_full (instead of charge_full)

master
Kiri 2024-04-24 14:53:04 +02:00
parent 5c4e368819
commit 57197b8e01
No known key found for this signature in database
GPG Key ID: F1BEE619CFF29825
1 changed files with 5 additions and 0 deletions

View File

@ -374,6 +374,11 @@ waybar::modules::Battery::getInfos() {
if (mainBatHealthPercent == 0.0f || batHealthPercent < mainBatHealthPercent) {
mainBatHealthPercent = batHealthPercent;
}
} else if (energy_full_exists && energy_full_design_exists) {
float batHealthPercent = ((float)energy_full / energy_full_design) * 100;
if (mainBatHealthPercent == 0.0f || batHealthPercent < mainBatHealthPercent) {
mainBatHealthPercent = batHealthPercent;
}
}
}