This commit is contained in:
Damocles 2026-04-12 18:44:27 +02:00
parent 21f96dc68e
commit b06e3582ff
23 changed files with 597 additions and 197 deletions

View file

@ -28,19 +28,37 @@ M.BarSection {
SequentialAnimation {
running: root._critical
loops: Animation.Infinite
NumberAnimation { target: root; property: "_blinkOpacity"; to: 0.2; duration: 400; easing.type: Easing.InOutQuad }
NumberAnimation { target: root; property: "_blinkOpacity"; to: 1; duration: 400; easing.type: Easing.InOutQuad }
onRunningChanged: if (!running) root._blinkOpacity = 1
NumberAnimation {
target: root
property: "_blinkOpacity"
to: 0.2
duration: 400
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: root
property: "_blinkOpacity"
to: 1
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
root._blinkOpacity = 1
}
property bool _warnSent: false
property bool _critSent: false
onChargingChanged: { _warnSent = false; _critSent = false; }
onChargingChanged: {
_warnSent = false;
_critSent = false;
}
onPctChanged: {
if (charging) return;
if (charging)
return;
if (pct < _critThresh && !_critSent) {
_critSent = true; _warnSent = true;
_critSent = true;
_warnSent = true;
_notif.command = ["notify-send", "--urgency=critical", "--icon=battery-low", "--category=device", "Very Low Battery", "Connect to power now!"];
_notif.running = true;
} else if (pct < _warnThresh && !_warnSent) {
@ -50,7 +68,9 @@ M.BarSection {
}
}
Process { id: _notif }
Process {
id: _notif
}
M.BarIcon {
icon: {