Don't display when unsupported

This commit is contained in:
EinBowser
2025-11-04 14:20:23 +01:00
parent c0d64c4630
commit c1ff57c3d0
2 changed files with 2 additions and 4 deletions
@@ -86,7 +86,7 @@ StyledPopup {
RowLayout {
spacing: 5
visible: Config.options.battery.showHealth
visible: Config.options.battery.showHealth && Battery.health > 0
Layout.fillWidth: true
MaterialSymbol {
@@ -35,14 +35,13 @@ Singleton {
if (!Config.options.battery.showHealth) {
return 0;
}
const devList = UPower.devices.values;
for (let i = 0; i < devList.length; ++i) {
const dev = devList[i];
if (dev.isLaptopBattery && dev.healthSupported) {
const health = dev.healthPercentage;
if (health === 0) {
return 0;
return 0.01;
} else if (health < 1) {
return health * 100;
} else {
@@ -54,7 +53,6 @@ Singleton {
})()
onIsLowAndNotChargingChanged: {
if (!root.available || !isLowAndNotCharging) return;
Quickshell.execDetached([