forked from Shinonome/dots-hyprland
battery: prevent auto suspend due to low bluetooth batt (#1882)
This commit is contained in:
@@ -12,12 +12,12 @@ Singleton {
|
|||||||
property var chargeState: UPower.displayDevice.state
|
property var chargeState: UPower.displayDevice.state
|
||||||
property bool isCharging: chargeState == UPowerDeviceState.Charging
|
property bool isCharging: chargeState == UPowerDeviceState.Charging
|
||||||
property bool isPluggedIn: isCharging || chargeState == UPowerDeviceState.PendingCharge
|
property bool isPluggedIn: isCharging || chargeState == UPowerDeviceState.PendingCharge
|
||||||
property real percentage: UPower.displayDevice.percentage
|
property real percentage: UPower.displayDevice?.percentage ?? 1
|
||||||
readonly property bool allowAutomaticSuspend: Config.options.battery.automaticSuspend
|
readonly property bool allowAutomaticSuspend: Config.options.battery.automaticSuspend
|
||||||
|
|
||||||
property bool isLow: percentage <= Config.options.battery.low / 100
|
property bool isLow: available && (percentage <= Config.options.battery.low / 100)
|
||||||
property bool isCritical: percentage <= Config.options.battery.critical / 100
|
property bool isCritical: available && (percentage <= Config.options.battery.critical / 100)
|
||||||
property bool isSuspending: percentage <= Config.options.battery.suspend / 100
|
property bool isSuspending: available && (percentage <= Config.options.battery.suspend / 100)
|
||||||
|
|
||||||
property bool isLowAndNotCharging: isLow && !isCharging
|
property bool isLowAndNotCharging: isLow && !isCharging
|
||||||
property bool isCriticalAndNotCharging: isCritical && !isCharging
|
property bool isCriticalAndNotCharging: isCritical && !isCharging
|
||||||
|
|||||||
Reference in New Issue
Block a user