Skip to content

feat(bluetooth): add native adapter-scoped management#18

Open
k8rito01 wants to merge 2 commits into
HANCORE-linux:mainfrom
k8rito01:feat/native-bluetooth-management
Open

feat(bluetooth): add native adapter-scoped management#18
k8rito01 wants to merge 2 commits into
HANCORE-linux:mainfrom
k8rito01:feat/native-bluetooth-management

Conversation

@k8rito01

Copy link
Copy Markdown

Summary

  • Use Bluetooth.defaultAdapter and its adapter-scoped device model for power, discovery, state, connect, disconnect, and forget.
  • Remove fixed device truncation and keep the full list scrollable.
  • Show pairing prompts, failures, and timeouts in the panel.
  • Use bluetoothctl only as the interactive BlueZ PIN/passkey agent because Quickshell 0.3 does not expose a pairing-agent UI API.
  • Offer Forget only for paired/saved devices.
  • Document Quickshell 0.3+ and bluez-utils requirements.

Validation

  • qmllint versions/V1/panels/BluetoothPanel.qml
  • git diff --check
  • Verified SplitParser receives non-newline interactive output chunks in an isolated Quickshell process.
  • Scope: Bluetooth panel, Bluetooth icon mapping, and its compatibility note only.

Use Quickshell's default adapter and its device model for power, discovery, connection state, connect, disconnect, and forget actions. Keep bluetoothctl only as an interactive BlueZ pairing agent so PIN/passkey prompts, failures, and timeouts remain visible in the panel.

Remove device truncation, keep long lists scrollable, and document the Quickshell and bluez-utils requirements.

Co-Authored-By: Codex <noreply@openai.com>
@HANCORE-linux

Copy link
Copy Markdown
Owner

Thanks for splitting this out. Adapter-scoped devices, removal of the 12-device truncation, visible errors/timeouts, and keeping bluetoothctl only for interactive pairing are all good changes.

Two merge gates remain:

1. Quickshell rollout compatibility

The panel statically imports Quickshell.Bluetooth, while BluetoothPanel is eagerly instantiated by shell.qml. The installer currently checks only that qs exists; it does not enforce Quickshell 0.3. Updating an existing installation with an older Quickshell could therefore make the shell configuration fail to load. A README note alone does not protect Self-Update users.

Preferred fix:

  • keep a small wrapper panel without the Bluetooth import;
  • load the native Quickshell 0.3 implementation lazily;
  • retain the current bluetoothctl implementation as the Loader-error/version fallback.

The alternative is a hard Quickshell 0.3 preflight in both installation and Self-Update before deployment, but that has a larger rollout blast radius.

2. Real pairing validation

The SplitParser test proves chunk delivery, but not that the selected BlueZ agent capability and stdin flow work with actual devices. Please provide or explicitly leave for maintainer runtime validation:

  • connect/disconnect an already paired device;
  • pair a normal new device;
  • pair a device requiring PIN entry or passkey confirmation;
  • reject/cancel pairing;
  • pairing timeout;
  • missing bluetoothctl should produce a direct dependency message instead of an ambiguous timeout/failure.

The native state/actions look structurally sound; these two points are what remain before merge.

… Quickshell <0.3

BluetoothPanel is instantiated eagerly by shell.qml, so importing Quickshell.Bluetooth
directly made the whole shell fail to load on installs whose Quickshell predates the
native Bluetooth API (e.g. a Self-Update that upgraded the config but not Quickshell).
The panel is now a thin wrapper with no Bluetooth import that lazily loads the native
implementation (BluetoothPanelNative.qml); if that import is unavailable it falls back
automatically to the bluetoothctl implementation (BluetoothPanelLegacy.qml), so the
panel keeps working and the shell always loads regardless of Quickshell version.
README updated to describe the automatic fallback.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@k8rito01
k8rito01 force-pushed the feat/native-bluetooth-management branch from e1459a6 to 1423fdc Compare July 13, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants