Skip to content

Fix Bluetooth tray icon and power switch when the radio is off - #11252

Open
mayannath wants to merge 2 commits into
omacom:quattrofrom
mayannath:fix-bluetooth-icon-hidden-when-off
Open

mayannath wants to merge 2 commits into
omacom:quattrofrom
mayannath:fix-bluetooth-icon-hidden-when-off

Conversation

@mayannath

@mayannath mayannath commented Sep 11, 2026 •

Copy link
Copy Markdown

Summary

  • Turning Bluetooth off through the bar's power toggle calls rfkill block bluetooth (so the off-state survives reboots), which drops the adapter from BlueZ entirely rather than merely disabling it.
  • Panel.qml's icon property only accounted for a disabled-but-present adapter, returning an empty string when adapter was null; the widget's visible: adapter !== null binding then hid it outright — the tray icon vanished instead of showing the disabled glyph (󰂲).
  • The power switch itself was also hidden (visible: !!root.adapter), and toggleBluetooth() no-op'd on a null adapter — so once Bluetooth was off, there was no way left to turn it back on from the panel at all.

Fix

  • icon: treat "no adapter" and "adapter disabled" the same way, both showing the disabled glyph.
  • Widget: stay visible: true always, and let icon alone carry the on/off/disabled state.
  • Power switch: stay visible regardless of adapter presence.
  • toggleBluetooth(): no longer bails out when there's no adapter — it can still ask omarchy-bluetooth-power to turn the radio back on.
  • Updated the pinned source-regex test for the toggle call, and added coverage for the null-adapter cases across the icon, widget visibility, and switch.

Test plan

  • Reproduced: toggled Bluetooth off via the bar switch, tray icon disappeared entirely and the panel offered no way to turn it back on.
  • Applied the fix locally via omarchy plugin clone omarchy.bluetooth, confirmed with screenshots that the icon shows the disabled glyph when off and the normal glyph when on, and that the power switch stays visible and functional in both states.
  • Noted, but not part of this fix: after the adapter reappears, the tray icon can lag a few to ~20s before catching up, self-correcting without a shell restart. That reactivity gap lives in Quickshell's own Bluetooth service, not in this widget.
  • ./test/all — 5 pre-existing failures (missing omarchy-pkgs checkout, a locale-encoding issue in an unrelated test, and a bar-icon centering test), all reproduced identically on unmodified master; none related to this change.

rfkill-blocking Bluetooth (which is how the bar's own power toggle turns
it off, so the state survives reboots) drops the adapter from BlueZ
entirely rather than merely disabling it. The panel's icon logic only
handled a disabled-but-present adapter, returning an empty string when
adapter was null, and the widget's `visible: adapter !== null` binding
hid it outright. Together these made the tray icon vanish instead of
showing the intended disabled glyph.
toggleBluetooth() no-op'd when the adapter was null, and the power
switch itself was hidden in that case too (visible: !!root.adapter).
Combined with the icon/visibility fix in the previous commit, turning
Bluetooth off left no way to turn it back on from the panel: the
switch disappeared, and even reaching it via IPC did nothing.

Updates the pinned source-regex test for the toggle's rfkill call and
adds coverage for the null-adapter cases (icon, widget visibility,
switch visibility, and the toggle no longer bailing out).
@mayannath mayannath changed the title Fix Bluetooth tray icon disappearing when radio is off Fix Bluetooth tray icon and power switch when the radio is off Sep 11, 2026
@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down. The bug is real: on quattro, Panel.qml hides the widget and the power switch when Bluetooth.defaultAdapter is null, and toggleBluetooth() returns early. A block that takes the controller out of BlueZ leaves no way back from the bar. The block also persists, so after a reboot the adapter can be null from the moment the shell starts.

Five other open pull requests fix the same thing: #12241, #12585, #13204, #13655 and #13806. I compared all six diffs against quattro. This one makes the widget and switch visible: true unconditionally, which has two side effects:

  • Machines with no Bluetooth hardware. The Bluetooth widget is on the default bar (config/omarchy/shell.json). On a desktop or VM without a controller it currently stays hidden. With this change it would always show the off glyph 󰂲 and a switch that can only run omarchy-bluetooth-power on, which fails because there is nothing to turn on.
  • Mixed signals when the radio is blocked. The icon shows "off", but heroStatusText still says "No adapter" and the empty-list text still says "No Bluetooth adapter" (Panel.qml around lines 77 and 871), right beside a switch that says it can turn the radio on.

#13204 and #12585 tell a blocked radio apart from missing hardware by asking rfkill, which still lists the switch while it is blocked. That works from a cold start, and it leaves machines with no Bluetooth hardware untouched. #12585 is the more complete of the two, but it no longer merges cleanly. #12241 and #13806 latch on "an adapter was seen once", so they don't help after a reboot with the block set. #13655 takes the same visible: true approach as this one.

How this was checked: Claude Opus 5.5 read the diffs and the surrounding code. Nothing was run on a worker, because a fix that isn't the one going forward isn't worth spending a worker on. There was no second opinion: the configured reviewer (Codex Medium) answered a ping, but today's review budget was already spent, so the comparison above is one model's reading.

Next step: the maintainer chooses between the competing fixes. Nothing is needed from you unless they ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants