Skip to content

Let the user choose Bluetooth status on login

Currently there is no GUI method for the user to choose whether Bluetooth is on or off at login. Instead, it is decided automatically for them by the presence or absence of the AutoEnable=true key in /etc/bluetooth/main.conf. This is a root-owned file that does not permit user configuration if it is shipped by a distro, because any changes made will be blown away on the next system update.

This commit adds a GUI to allow the user to determine the Bluetooth status on login: always enabled, always disabled, or remember the previous status. The default is to remember the previous status, with the initial status on first boot being determined by the distro's default value in the /etc/bluetooth/main.conf config file if present; if not present, bluez's own default value is "disabled". Regardless, thereafter the enablement status on boot will be determined by Bluedevil.

Implementation-wise, this is accomplished by adding support in the KDED module for reading a new config file key set by the KCM which controls what do do with Bluetooth when launched. It already has support for saving and restoring status when the system goes to sleep and wakes up; this was extended for shutdown/startup events too.

Another thing to note is the Bluedevil KCM currently uses the instant apply paradigm, so I have implemented the option also using the instant apply paradigm. I thought it would be weird for only one setting in the KCM to activate the Apply button when toggled, and for none of the others ones to. If this is undesirable, we can port all the controls in the KCM to use the explicit apply paradigm later.

BUG: 440493 FIXED-IN: 5.23

Screenshot_20210811_183847

To test, manipulate the values in the KCM and reboot and make sure your choice was honored. If rebooting is too annoying or time-consuming, you can also mimic it by restarting kded with kded5 --replace &. That works too.

cc @teams/vdg @teams/usability @ilyabizyaev @drosca

Edited by Nate Graham

Merge request reports