Repository navigation
Show Bluetooth pairing passkeys so keyboards can bond - #6877
gabriel-laet wants to merge 6 commits into
Conversation
NoInputNoOutput cannot display a PIN, and a failed pair still trusted the device so the panel connected instead of pairing again. BLE HID keyboards such as the HHKB never finished bonding from the panel.
There was a problem hiding this comment.
Pull request overview
Adds Bluetooth passkey display support for BLE keyboards and prevents failed pairings from leaving devices trusted but unbonded.
Changes:
- Adds a notification-based BlueZ pairing agent.
- Gates trust/connect operations on successful pairing.
- Updates panel bond detection, migration, and tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/omarchy-bluetooth-agent |
Implements the BlueZ passkey agent. |
bin/omarchy-bluetooth-device |
Trusts and connects only after successful pairing. |
default/systemd/user/bt-agent.service |
Launches the new agent. |
migrations/1786728635.sh |
Reloads and restarts the user service. |
shell/plugins/panels/bluetooth/Model.js |
Adds bond-state projection and detection. |
shell/plugins/panels/bluetooth/Panel.qml |
Re-pairs trusted but unbonded devices. |
test/shell.d/bluetooth-test.sh |
Tests bond handling and pairing sequencing. |
test/shell.d/systemd-test.sh |
Tests agent service configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Migrations run under bash -euo pipefail, so an unguarded systemctl --user call aborts the whole run for anyone without a live user manager. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Critical toasts never expire in the Omarchy shell and survive restarts, so a passkey nobody typed stayed on screen for good. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
It only arrives transitively through uwsm today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (1)
default/systemd/user/bt-agent.service:17
- The service now runs Omarchy’s custom Agent1 implementation, but its unit metadata still describes the old auto-accept agent and points operators to
bt-agent(1). Update the description and documentation target sosystemctl statuslinks to the API this process actually implements.
ExecStart=/usr/bin/omarchy-bluetooth-agent
The unit now runs omarchy-bluetooth-agent, not bt-agent, so drop the stale man:bt-agent(1) reference and describe the passkey behavior.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (1)
migrations/1786728635.sh:11
- Both required migration actions suppress failure, so a transient
daemon-reloador restart error still marks the migration complete and leaves the existing session running the old agent indefinitely. Let these commands fail so the migration runner can retry; onlyreset-failedis safe to keep best-effort.
systemctl --user daemon-reload >/dev/null 2>&1 || true
if systemctl --user is-enabled --quiet bt-agent.service 2>/dev/null; then
systemctl --user reset-failed bt-agent.service 2>/dev/null || true
systemctl --user restart bt-agent.service || true
omarchy-base.packages only feeds the ISO pacstrap and the quattro upgrade, so an existing install never received python-dbus from the base list alone. The migration restarted bt-agent.service into a unit whose new ExecStart fails on `import dbus`, and Restart=on-failure then looped it every two seconds. Install the package first, and let a failed install stop the migration so it stays pending instead of bouncing the agent without its dependency. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KKMv5b5JWcHxoX4QC79BPJ
|
Pushed 58106d4: the migration now runs The branch still merges cleanly onto current Related reports this also resolves: #8485 (MX Mechanical Mini passkey), #7879 / #7880 (trusted-but-unbonded devices never re-pair), #9676 (bt-agent prompts without a terminal) and #6992 (missing |
|
Automated duplication check: this pull request looks similar to #9965, which covers the same Bluetooth pairing agent. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
What
BLE HID keyboards that require a passkey (HHKB Studio and similar) cannot finish pairing from the Omarchy Bluetooth panel.
Why
Three things stacked:
bt-agentran asNoInputNoOutput, which auto-accepts Just Works but cannot display a PIN.omarchy-bluetooth-device pairtrusted the device even whenbluetoothctl pairfailed, then tried to connect.trustedas already paired, so the next click only connected. The keyboard was left trusted, unpaired, and stuck.Reproduced on Omarchy 4.0 with an HHKB Studio: the agent looped
Authorize this device pairing (yes/no)?, pairing timed out, the device stayedTrusted: yes/Paired: no, and HOG connect failed.Change
omarchy-bluetooth-agent(KeyboardDisplay) shows the six-digit passkey viaomarchy-notification-send. Just Works still auto-accepts.paired || bonded. Trusted-without-a-bond pairs again.bt-agent.serviceso existing sessions pick up the new agent.Test
bash test/shell.d/bluetooth-test.shbash test/shell.d/systemd-test.sh./test/cliMice/headphones that already used Just Works are unchanged. Keyboards now get a notification with the code to type on the device.
Fixes #8485, #7879, #9676, #6992