From c1ff57c3d043d995a1f9a4b85451b9d7ee09e42f Mon Sep 17 00:00:00 2001 From: EinBowser <146022965+EinBowser@users.noreply.github.com> Date: Tue, 4 Nov 2025 14:20:23 +0100 Subject: [PATCH] Don't display when unsupported --- dots/.config/quickshell/ii/modules/bar/BatteryPopup.qml | 2 +- dots/.config/quickshell/ii/services/Battery.qml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/bar/BatteryPopup.qml b/dots/.config/quickshell/ii/modules/bar/BatteryPopup.qml index bba4c422c..6e4bf1c9e 100644 --- a/dots/.config/quickshell/ii/modules/bar/BatteryPopup.qml +++ b/dots/.config/quickshell/ii/modules/bar/BatteryPopup.qml @@ -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 { diff --git a/dots/.config/quickshell/ii/services/Battery.qml b/dots/.config/quickshell/ii/services/Battery.qml index 39aa720ab..849870cd2 100644 --- a/dots/.config/quickshell/ii/services/Battery.qml +++ b/dots/.config/quickshell/ii/services/Battery.qml @@ -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([