mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
Don't display when unsupported
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user