10

How can the friendly device name of a remote Bluetooth device be changed (using a command-line tool in Linux or similar)? I have looked at some of the software included in bluez-tools such as hcitool and bt-device, but none of these have the feature to change the remote device name. There does not seem to be any HCI command for doing this either.

I am aware of that it is possible to change the alias of devices in many bluetooth managers, but that is not the same thing. The alias is only visible on the local computer, while the device name is visible to all new devices.

1
  • This answer on Ask Ubuntu should work with just one step.
    – Daniel
    Oct 9, 2015 at 9:57

3 Answers 3

12

Use bt-device (part of the bluez-tools package).

Get a list of paired devices:

bt-device -l

To set the new alias:

bt-device --set macaddress|name Alias "New Name"

ie:

bt-device --set S530 Alias "S530 Blue"
3
  • HOWEVER: although this works for almost every other bluetooth tool, it appears that the bluetooth gui manager that comes installed on MintOS does not actually display the Alias (which can be changed) but the default Name, which cannot. Aug 3, 2018 at 1:05
  • 1
    Does not affect Ubuntu 20.04 'Settings - Bluetooth Devices' name, although 'bt-device -l' shows alias has been set and 'sudo service bluetooth restart' has been done. .
    – brewmanz
    Jan 21, 2021 at 22:27
  • 1
    Ubuntu 20.04 'Settings - Bluetooth Devices' displays the bluetooth remote device name, not the alias, so changing the alias has no visible effect. The bluetooth remote device name is [ro] (read-only), see manpages.ubuntu.com/manpages/bionic/man1/bt-device.1.html
    – marianoju
    Jul 14, 2021 at 16:54
8

Answering over half a year later, but better late than never. It may help other people.

This answer is based on this blog post. It worked for me. In a very Linux-y style of doing things, it's based on editing configuration files rather than using a tool.

You need to edit two files:

  • In /var/lib/bluetooth/[your MAC address]/config, edit the line that starts with name.

  • In /etc/bluetooth/main.conf change the line with Name = %h-%d so that it reads only Name = %h, assuming you want to use your hostname as your bluetooth name (the %d adds a different index for each local bluetooth adapter, but you probably only have one). Using something else should work, but I haven't tried that myself.

Once you're done, restart the bluetooth service:

$ sudo service bluetooth restart
1
  • 1
    This works for bluez5 (I see the changed name when scanning from another device). While I'm happy that you wrote this I'm sad that setting the name in /etc/bluetooth/main.conf has no effect. :(
    – wojci
    Jan 11, 2016 at 13:44
6

On Fedora I use the command bluetoothctl to change these settings.
This is provided by the package bluez, and in my case it was already installed.

bluetoothctl has a prompt that is accessed simply by running the command.
Its commands can also be used without accessing the prompt, but that way there is no autocompletion.

There is a distinction between external devices (mouse, keyboard, gamepad, etc.), and the host controllers (built-in BT card, external USB BT adapter, etc.).

With bluetoothctl is possible to change both device and controller alias, the process can be summed up in 3 steps:

  • list the available controller/devices
  • select the controller/device to modify
  • modify the controller/device

The commands are:

Controller

  • run bluetoothctl to access its prompt
  • run list to list the available controllers
    • in my case I only have 1 controller, my laptop's BT card
  • run select 00:11:22:33:44:55 to select the controller to modify
    • the address can be autocompleted with TAB, in my case is the only 1 address available
  • run system-alias "new alias for my BT controller" to modify the controller alias

Device

  • run bluetoothctl to access its prompt
  • run devices to list the available devices
    • the output can be filtered by using optional properties, for example devices Connected
  • run connect AA:BB:CC:DD:EE:FF to select the devices to modify
    • the address can be autocompleted with TAB
  • run set-alias "new alias for my BT device" to modify the device alias

help can be used to get an overview of the available commands:

[bluetooth]# help
Menu main:
Available commands:
-------------------
...
list                                              List available controllers
...
select <ctrl>                                     Select default controller
devices [Paired/Bonded/Trusted/Connected]         List available devices, with an optional property as the filter
system-alias <name>                               Set controller alias
reset-alias                                       Reset controller alias
...
set-alias <alias>                                 Set device alias
...
connect <dev>                                     Connect device
...
2
  • set-alias works in Fedora so I can see the new name in the UI menu Nov 4, 2023 at 14:22
  • 1
    You can also edit /var/lib/bluetooth/$ADAPTER_MAC/$DEVICE_MAC/info and add a line in [General]: Alias=My New Alias, followed by systemctl restart bluetooth. (Tested under Fedora 39)
    – MrTomRod
    Jan 19 at 11:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .