mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 20:31:57 +00:00
battery: fix charging warning when low -> plug -> unplug
This commit is contained in:
parent
6be83d0050
commit
e85a899be0
1 changed files with 7 additions and 4 deletions
|
|
@ -17,11 +17,14 @@ Singleton {
|
|||
property bool isCritical: percentage <= ConfigOptions.battery.critical / 100
|
||||
property bool isSuspending: percentage <= ConfigOptions.battery.suspend / 100
|
||||
|
||||
onIsLowChanged: {
|
||||
if (available && isLow) Hyprland.dispatch(`exec notify-send "Low battery" "Consider plugging in your device" -u critical -a "Shell"`)
|
||||
property bool isLowAndNotCharging: isLow && !isCharging
|
||||
property bool isCriticalAndNotCharging: isCritical && !isCharging
|
||||
|
||||
onIsLowAndNotChargingChanged: {
|
||||
if (available && isLowAndNotCharging) Hyprland.dispatch(`exec notify-send "Low battery" "Consider plugging in your device" -u critical -a "Shell"`)
|
||||
}
|
||||
|
||||
onIsCriticalChanged: {
|
||||
if (available && isCritical) Hyprland.dispatch(`exec notify-send "Critically low battery" "🙏 I ask for pleas charge\nAutomatic suspend triggers at ${ConfigOptions.battery.suspend}%" -u critical -a "Shell"`)
|
||||
onIsCriticalAndNotChargingChanged: {
|
||||
if (available && isCriticalAndNotCharging) Hyprland.dispatch(`exec notify-send "Critically low battery" "🙏 I ask for pleas charge\nAutomatic suspend triggers at ${ConfigOptions.battery.suspend}%" -u critical -a "Shell"`)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue