omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Low-battery warning expires unseen when it fires while the session is locked, and nothing else warns before UPower's forced suspend at 2%

Open isc opened this issue 3 weeks ago • 1 comments

System details

Apple MacBook Air (M1, 2020), omarchy-dev 4.0.0.r7608.g14abc07 (the battery service and omarchy-battery-low are identical to quattro today), quickshell 0.3.2, UPower 1.91.5

What's wrong?

Since #16562 the low-battery warning is a normal toast that expires after 30 seconds. The PR names the trade-off: a warning sent while nobody is at the screen is gone after 30 seconds. In practice the warning can be missed entirely, and because it is the only one before UPower's critical action, the first thing I noticed was the machine suspending itself.

What happened today (local times, from journalctl, UPower's charge history and ~/.local/state/omarchy/notifications/history.json):

Time Battery Event
12:25 Idle lock. Display off (DPMS) from 12:36
13:22:44 10% "Time to recharge! Battery is down to 10%" sent, behind the lock screen with the display off
13:23:15 Toast expires (closed_reason: expired) and goes to history
13:52 9% I unlock: nothing on screen
14:18:44 2% suspend requested from client PID 1422 ('upowerd'): UPower's critical action (PercentageAction=2, CriticalPowerAction=Auto) locks and suspends
14:19:48, 14:20:55 under 2% Suspends again about a minute after each wake
14:21:57 1% A second warning, "Battery is down to 1%": the first one I actually saw

So between 10% and the forced suspend at 2% there was nothing on screen. The suspends looked like a crash: a black screen, then the lock screen, three times in a row. I haven't checked why a second warning fired at 1% (possibly the latch resetting across a resume, as in #9670).

In the code, bin/omarchy-battery-low sends the warning with -u normal -t 30000, and shell/plugins/services/battery/Service.qml has a single batteryThreshold: 10 with the notifiedLowBattery latch, so there is one warning per discharge.

What would have avoided it:

  • A warning sent while the session is locked or the display is off is still there when I come back, for example by sending it again on unlock if the battery is still low and discharging.
  • A second warning shortly before UPower's critical action (around 5%), so the forced suspend isn't the first sign.

Related: #16562, #14639, #13256 and #13540 (critical action at 2%), #9670, #1962 (earlier attempt at several thresholds).

isc avatar Nov 08 '26 19:11 isc

Reproduced this on a Dell XPS 9320 (dev channel, current quattro), with the threshold temporarily raised to 50% so I didn't have to drain it:

  • 12:56:54 locked
  • 13:00:41 "Battery is down to 50%" sent behind the lock screen
  • 13:01:11 expired (closed_reason: expired in the notification history)
  • 13:16:20 unlocked, nothing on screen

Same as yours: if you're away when it fires, you never see it.

One more idea alongside the two you listed: a small battery indicator on the lock screen, shown only while the battery is low and discharging. The lock stays minimal the rest of the time, and you see it the moment you wake the screen. Sometime you come back to the computer, you see the lock screen (no idea you're low) and it dies just when you're setting into a good work flow. You end up losing time because some laptops won't even reboot until the battery is charged x%.

raffsmagic avatar Nov 10 '26 22:11 raffsmagic