control-center: route Bluetooth power toggles through DMS backend - #3082
control-center: route Bluetooth power toggles through DMS backend#3082alamin147 wants to merge 1 commit into
Conversation
|
We have soft rfkill unblocking built in, it can be instantiated when toggling device maybe instead function setBluetoothEnabled(enabled) {
if (DMSService.isConnected && DMSService.capabilities.includes("bluetooth")) {
DMSService.sendRequest("bluetooth.setPowered", { powered: enabled }, ...)
return
}
if (adapter)
adapter.enabled = enabled
}It may require udev rules since its unprivileged (or just being in bluetooth group on some distros), but maybe we can build escalation into the existing infra instead of executing external commands like pkexec. Kinda similar to CUPS service but not exactly since cups itself is the one that raises privilege escalation. I'd rather make rfkill unblocking a behind the scenes event than a user-prompted event though, that can fail and log if it doesnt succeed. Since from my POV at least, if I want to use a bluetooth adapter rfkill unblocking is something I just expect to be done implicitly. |
|
Yeah I understand. I will look into it and implement built in system |
6ffd8af to
610acfa
Compare
|
Thanks, agreed. I updated the PR to route the normal Bluetooth toggle through bluetooth.setPowered, with the Quickshell adapter as fallback. This uses the existing implicit soft-rfkill handling and removes the button and pkexec command. The branch is rebased and lint passes. @bbedward |
marcusramberg
left a comment
There was a problem hiding this comment.
Lgtm. Was actually just chasing why control center wasn't unblocking rfkill, so very happy to see someone else already chasing it. 😀
Description
The Control Center previously toggled
BluetoothService.adapter.enableddirectly, bypassing DMS’s Bluetooth backend.This change routes Bluetooth power toggles through
bluetooth.setPoweredwhenever the DMS Bluetooth capability is available. The backend already attempts soft-rfkill unblocking before enabling the BlueZ adapter, making recovery automatic and invisible to the user.If the backend is unavailable, it falls back to the Quickshell Bluetooth adapter.
What changed
BluetoothService.setBluetoothEnabled()Testing
make lint-qmlpassesgit diff --checkpasses