Skip to content

fix(bluetooth): allow Chromium to power on for phone passkeys - #13867

Open
mareks77 wants to merge 8 commits into
omacom:quattrofrom
mareks77:fix/bluetooth-passkey-power
Open

mareks77 wants to merge 8 commits into
omacom:quattrofrom
mareks77:fix/bluetooth-passkey-power

Conversation

@mareks77

@mareks77 mareks77 commented Sep 30, 2026 •

Copy link
Copy Markdown

TL;DR

Set BlueZ Powered=false for normal off instead of rfkill-blocking Bluetooth so Chromium can turn it back on for phone passkeys. Restore saved power preferences at graphical login, independently for each adapter.

Why

Omarchy’s off path sets an rfkill software block. Chromium requests only org.bluez.Adapter1.Powered=true, which BlueZ rejects while blocked; the browser cannot clear that restriction.

What

  • Replace boot-persistent blocking with atomically saved preferences and graphical-login restoration, including delayed Bluetooth availability.
  • Snapshot adapters independently by stable Bluetooth address. A blocked secondary retains its preference without discarding a primary’s intentional off; legacy single-line preferences remain supported.
  • Adopt the active update session without applying stale preferences or interrupting connections. Leave an existing monitor unchanged and enable normal restoration for the next login.

Logout preserves only the adapters whose state cannot safely represent a new choice:

flowchart LR
  A[Session stops] --> Q{"Current adapter instance restored or session adopted?"}
  Q -->|No| K[Keep that adapter's preference]
  Q -->|Yes| B{"Powered off and blocked or unreadable?"}
  B -->|Yes| K
  B -->|"No: was skipped if another radio was blocked"| S[Save that adapter's live power]
Loading

Risk

  • Previously blocked users must explicitly enable Bluetooth in Omarchy once. Migration preserves blocks because legacy Omarchy off and external airplane mode cannot be distinguished safely.
  • Bluetooth may auto-enable before graphical login; saved off is no longer enforced before the session starts.
  • External changes are saved on normal stop; a crash can leave an older preference.
  • Ship with omarchy-pkgs#738. Without its packaged unit, session persistence is unavailable.

Testing

  • Live panel-off testing left Bluetooth unblocked, and Chromium’s equivalent D-Bus power-on request succeeded; the old blocked path rejected it.
  • Live normal and transient update-session monitors preserved actual on power despite stale saved off, then captured on at stop.
  • Local ./test/all repeated the CLI failure and nine shell failures from unchanged baseline 8b4eae66. An earlier intermittent runtime-smoke failure passed on focused and aggregate reruns.
  • Full phone-passkey login and physical reboot remain unverified. Multi-adapter behavior was exercised with mocked BlueZ/rfkill, not physical secondary hardware.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Rewrites Bluetooth power management and adds a system service.

The PR appears safe to merge with its documented companion packaging change.

Summary

The PR replaces normal Bluetooth rfkill blocking with saved BlueZ power preferences, adds graphical-session restoration and update-session adoption, and expands regression coverage. Since the previous review, it renames the migration to avoid a timestamp conflict and updates the tests to use the new path.

Reviews (8) · Last reviewed commit: "fix(bluetooth): avoid a conflicting migr..."

Comment thread migrations/1790703856.sh Resolved
Comment thread migrations/1790703856.sh Resolved
Comment thread migrations/1790703856.sh Resolved
Comment thread migrations/1790703856.sh Resolved
@mareks77 mareks77 changed the title Keep Bluetooth power-on usable for Chromium phone passkeys fix(bluetooth): allow Chromium to power on for phone passkeys Sep 30, 2026
Comment thread migrations/1790703856.sh Resolved
Comment thread bin/omarchy-bluetooth-power Resolved
Comment thread bin/omarchy-bluetooth-power Resolved
Comment thread bin/omarchy-bluetooth-power Resolved
@jandrusk

jandrusk commented Oct 1, 2026

Copy link
Copy Markdown

Blocking (merge conflict): this PR and #13889 both add migrations/1790703856.sh with unrelated content. Please retarget to a fresh unused timestamp.

Also overlaps the smaller restore path in #13667 (“Remember Bluetooth power and restore it after login”). This PR is the more complete model (BlueZ Powered instead of rfkill so Chromium can raise the radio for passkeys; per-adapter prefs; adopt/monitor unit). If maintainers prefer this approach, #13667 should be closed as superseded once this is ready; if #13667 is closer to merge, this needs a rebase that does not double-enable restore units.

Nit: migration message about preserving existing rfkill blocks is good — please keep that user-visible note.

@mareks77

mareks77 commented Oct 1, 2026

Copy link
Copy Markdown
Author

Fixed in 954c43d: renamed the migration to migrations/1790784806.sh, unused in the latest quattro and distinct from #13889. All test references now use the new name. Migration content is unchanged, including the existing-rfkill-block warning; a regression assertion now protects that exact user-visible note. Bluetooth power, Bluetooth UI, and systemd focused checks passed, and a merge-tree check against latest quattro was clean.

Agreed that #13667 is an alternative, not something to stack with this implementation. It remains open/unmerged, and latest quattro has no competing restore unit, so this PR currently enables only its own monitor. Superseding #13667 is a maintainer decision; if that PR lands first, this branch will need to replace its restore path during rebase rather than enable both units.

@jandrusk

jandrusk commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for renaming the migration to migrations/1790784806.sh. That clears the collision with #13889 from my side, and the regression assertion on the rfkill note is a nice touch. Looks good to me.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants