fix(bluetooth): unblock rfkill when enabling a blocked adapter#2520
Closed
Mic92 wants to merge 1 commit into
Closed
fix(bluetooth): unblock rfkill when enabling a blocked adapter#2520Mic92 wants to merge 1 commit into
Mic92 wants to merge 1 commit into
Conversation
quickshell's BluetoothAdapter.setEnabled() bails out with "Cannot enable adapter because it is blocked by rfkill" and never writes the Powered property when the adapter is in the Blocked state. This leaves the bluetooth toggle dead after a partial airplane-mode exit (e.g. the user re-enables wifi via NetworkManager but bluetooth stays soft-blocked, and systemd-rfkill happily persists that across reboots). logind hands the active seat user rw on /dev/rfkill, so we can lift the soft block ourselves and power the adapter via bluetoothctl without any privilege escalation.
Contributor
|
I've changed the Bluetooth toggle to be disabled when Bluetooth is blocked a couple of days ago, so it would be great if you can revert this change in your PR (in BluetoothSubTab). |
Mic92
added a commit
to Mic92/dotfiles
that referenced
this pull request
Apr 24, 2026
The Framework airplane Fn key issues a kernel rfkill block all. Re-enabling wifi via NetworkManager leaves bluetooth soft-blocked, and quickshell's BluetoothAdapter.setEnabled() refuses to write Powered in that state, so the noctalia toggle goes dead and systemd-rfkill persists the block across reboots. Patch noctalia to lift the soft block itself when the user asks to enable a blocked adapter. While at it, also carry the plugin-fetch dead-cwd fix locally so we no longer depend on running from the fork branch. Upstream: noctalia-dev/noctalia#2520 noctalia-dev/noctalia#2343
Author
|
The actual bug is in quickshell actually... Let me move the patch to this layer. Here is the quickshell upstream project: quickshell-mirror/quickshell#765 will apply the same to the noctalia fork. |
Author
|
That's the better fix: https://github.com/noctalia-dev/noctalia-qs/pull/37 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
quickshell's
BluetoothAdapter.setEnabled()early-returns withCannot enable adapter because it is blocked by rfkilland never writes thePoweredproperty when the adapter is in theBlockedstate. That leaves the bluetooth toggle dead after a partial airplane-mode exit — e.g. the laptop's airplane Fn key (kernelrfkill block all), then wifi is re-enabled via NetworkManager while bluetooth stays soft-blocked.systemd-rfkillpersists that block across reboots, so the toggle stays broken until the user runsrfkill unblock bluetoothby hand.logindgrants the active seat userrwon/dev/rfkill(uaccess), so the shell can lift the soft block itself — same mechanismsetAirplaneMode()already relies on. When the adapter is blocked and the user asks to enable it, runrfkill unblock bluetooth && bluetoothctl power onand let the resulting state change propagate back through quickshell.Type of Change
Related Issue
Testing
Steps:
rfkill block bluetooth→bluetoothctl showreportsPowerState: off-blockedCannot enable adapter because it is blocked by rfkill, toggle does nothingBluetooth Adapter rfkill-blocked, unblocking, adapter ends upPowered: yesScreenshots / Videos
n/a (no visual change)
Checklist
Additional Notes
bluetoothctl power onis chained after the unblock because quickshell'ssetEnabledwould still see the staleBlockedstate if called synchronously; going throughbluetoothctlavoids the race without adding a timer.