How can I disable bluetooth auto connect for specific devices?
I have bluetooth headsets and speakers that I connect to different computers. These bluetooth devices will connect to the last computer they were connected to when powered on, but I'd like to disable that for these specific devices that we use among different computers. As it stands, it is quite annoying to have to find the computer the device auto connected to and manually disconnect before being able to connect to the new computer. Is it possible to disable auto connect for specific devices? And if so, how would I do that?
3 Answers
In short, you can untrust a device in bluetootctl to leave it paired but prevent autoconnection.
See my full answer on a similar question with more votes (sorry :sweaty smile:):
1User Elder Geek provided a solution here that looks like it may work:
1
Install blueman bluetooth manager from the Software Center or with this command:
sudo apt install bluemanNote: Installation requires the universe repository to be enabled in your software sources.
Open Blueman from the Dash.
Select the headset from the list
Click Setup...
A window will open up, on that window, check Do not connect.
Click the Next button.
In console type one by one:
bluetoothctl
devicesto get the address of the device you want.
Create a text file anywhere on your computer with any name.
(Try to stay away from root or certain system folders, you can use home or desktop)
#!/bin/bash
sleep 5; echo "disconnect XX:XX:XX:XX:XX:XX" | bluetoothctlType that in the text file and save.
(XX:XX:XX:XX:XX:XX is device address)
In properties of the file, or in console, make the file executable.
In system settings, add the file to autostart.
(Or in console, use whatever you are using to autostart programs or scripts.)
In the code above;
#!/bin/bashturns the file into an executable script.
sleep 5makes it wait for 5 seconds.
echoWrites the command next to it.
disconnect XX:XX:XX:XX:XX:XXdisconnects from the device, whose address is specified as XX:XX:XX:XX:XX:XX
bluetoothctlis the bluetooth environment command to configure bluetooth devices.
If 5 seconds is not enough, use a bigger number.
If you change the disconnect command to connect, you can use the same script to auto connect bluetooth devices.