Repository navigation
omamobile-shell 0.2.142: status bar battery styles and per-icon switches - #1010
Conversation
The bar reads two new keys from shell.json's bar object: - batteryStyle: icon, percent, icon-percent (default), horizontal, or horizontal-percent (a drawn battery with the number inside). Without it, showBatteryPercent decides as before. - statusIcons: bluetooth, wifi, cell, dnd, unread; only false hides one. The battery is its own component (BatteryIndicator.qml). The charging bolt shows in every style while charging and no key hides it. At 10 % and under, not charging, every style takes the urgent colour. A hidden mobile signal stops omamobile-cell-watch; the watcher is started and stopped from that switch, not a binding the restart timer would break. test/all checks that wiring in Bar.qml. test/bar-render draws every style at 100 and 50 %, 50 % charging, 8 % and 8 % charging, in a dark and a light theme (run when OMAMOBILE_BAR_RENDER names a folder). Signed-off-by: Lef <me@lefteros.com>
derekross
left a comment
There was a problem hiding this comment.
Thank you, Lef, this is nicely done. I read it with one question in mind, whether someone who never touches shell.json sees any difference, and as far as I can tell they don't: the default is icon-percent, the older showBatteryPercent: false still gives the icon alone, the glyph, the low-battery colour and the number are the same as today, and the gap between them works out to the same 3 px with Omarchy's default spacing. Not running omamobile-cell-watch at all when the icon is hidden is a good touch, and keeping the bolt and the call chip without switches is right.
The one thing I'd like before merging is a short run on my 7 Pro, because it has the modem your phone doesn't: the default bar side by side with main's, the cell icon there with the modem up, and the watcher stopping and starting when I hide and show the icon. I'll do that and report here; nothing to change on your side unless it shows something.
Heads-up for the order: this one and #1014, #949, #994 and #998 all touch the bar, and I expect to land this one first, so the others will need a small rebase. I'll set the version when I merge.
derekross
left a comment
There was a problem hiding this comment.
I ran this on my Pixel 7 Pro today, with the modem up, built from your head merged with today's main:
- Default bar, no
shell.jsonchange: identical to main's 0.2.143 apart from the clock (Bluetooth, the cell bars with LTE, Wi-Fi off, the battery at 99 %: same glyphs, colours and spacing). Oneomamobile-cell-watchrunning. statusIcons.cell: false: the cell icon goes and its watcher stops within about 2 s. Putting the key back brings back the icon and exactly one watcher.batteryStyle: "horizontal-percent": the battery is drawn on its side with the percentage inside, and the bar is fine after each reload.shell.jsonrestored byte for byte, one Quickshell throughout.
So it passes on the 7 Pro. Before the merge it needs main merged in and the next shell number: main is at 0.2.143 now. I'll push that commit to your branch and squash it once CI is green.
# Conflicts: # packages/omamobile-shell/version
The phone bar gets two new keys on the
barobject in shell.json, so you can pick how the battery looks and hide icons you don't want:batteryStyle:icon,percent,icon-percent(default, same as today),horizontal,horizontal-percent(a drawn battery with the number inside). Without itshowBatteryPercentstill works like before.statusIcons:bluetooth,wifi,cell,dnd,unread. Onlyfalsehides one.The charging bolt always shows while charging, in every style, and there's no key to hide it. At 10 % and under (not charging) every style uses the urgent colour. Hiding the mobile signal also stops omamobile-cell-watch. The call chip has no switch since it's the way back to the call. Changes apply on
omarchy-shell shell reloadConfig, no restart or polling.On my Pixel 8 Pro (charging, 79 %), top to bottom: icon, percent, icon + percent, horizontal, horizontal with the number inside, and that one with Bluetooth and Wi-Fi hidden:
Offscreen renders from the new test/bar-render (every style at 100/50/8 %, 50 and 8 % charging, plus the hidden-icon and old-key cases), dark and light:
renders
What I tested: test/all passes in the CI container (it now also checks Bar.qml uses BatteryIndicator, the per-icon switches and the cell watcher wiring). bar-render 56/56 ok. On the phone: each style and the hidden icons, set through shell.json + reloadConfig with this code running, on the charger.
Not tested: the low battery colour and the non-charging look on the real screen (phone was at 79 % on the cable, those are only in the renders), the mobile signal switch with a modem (no modem on my phone yet), and a light theme on the phone.
I have a Settings page for this (Display > Status bar) on my settings branch, I'll send it after the pending settings PRs.