Changing a bluetooth device alias in Linux
I have two external bluetooth keyboards. One for at home and one at my office at
my gf's. They are the same keyboard. I wanted to rename them to distinguish on
my Ubuntu laptop. I struggled to edit using Ubuntu's settings control panel, or
using bluetoothctl, which seems like it should be able to rename an external
device, but all it can do is rename the controller.
Instead, I found that I can edit them manually, like this:
Get the mac address of the controller.
cd /var/lib/bluetooth/ && ls -l
Mine is 70:9C:D118:03:FC
cd 70\:9C\:D1\:18\:03\:FC/
Get the mac addresses of the devices (your device needs to be paired already, of course):
bluetoothctl devices
# F2:D8\:5C\:5C\:64\:1A/info
# ED:26:79:B3:78:C2
Pick the one you want and edit that info file:
vi F2\:D8\:5C\:5C\:64\:1A/info
Restart bluetooth.
bluetoothctl restart
This will disconnect the devices. My keyboard didn't seem to want to connect
easily, but after I poked around for a minute, it suddenly worked. So, maybe it
takes a few minutes, maybe it just needed me to type bluetoothctl a few times
or something. I did not have to reconnect, though.
Note: I did try this, but it didn't seem to work. The first time, it failed, the second time, my keyboard suddenly worked.
bluetoothctl connect F2:D8:5C:5C:64:1A