Ubuntu: Automatically connect bluetooth mouse



Question:

I have a bluetooth mouse (Apple Mighty Mouse) which I use with Kubuntu (KDE). I always have to manually connect to the mouse, although it is listed as a trusted device. How can I automatically connect the mouse when I have it turned on? Or at least reconnect after suspend?


Solution:1

You can use hciconfig to do that.

First manually connect your mouse as you usually do, then open a terminal and run hciconfig -a to retrieve its name. It should be something like hciX where X is the number of your device. You can either use hcitool scan, it should give the name as well.

Once this is done, you can force the bluetooth device detection by running

sudo hciconfig <name_of_your_mouse> reset  

In order to do that automatically at every boot, you want to edit /etc/init.d/bluetooth and append the magic line at the end of the file : hciconfig <name_of_your_mouse> reset. Then save, reboot, and it should work forever.

Also make sure that your mouse is plugged in at boot time. If you plug it in after booting you will have to manually detect the mouse again.

Hope this helps.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »