Automatically connect bluetooth device

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
Post Reply
iamtheway
Level 1
Level 1
Posts: 19
Joined: Mon Apr 15, 2019 9:52 pm

Automatically connect bluetooth device

Post by iamtheway »

I configure correctly bluetooth mouse, but each time I reboot or even after sleep, the mouse is not anymore connected. I need to go to bluetooth setting and re-connect manually. How to reconnect mouse automatically? I was able to make this work in Ubuntu, without any special configuration. It take sometime, but after it get connected automatically.

macbeto
Level 2
Level 2
Posts: 50
Joined: Tue Jan 29, 2019 5:04 am

Re: Automatically connect bluetooth device

Post by macbeto »

In case it helps you. This is what I do to check if my bluetooth mouse is able to be connected when i boot the PC. If can be reached it connects. It case it doesnt close the bluetooth connection in 5 seconds.
I created a script which is launched at the booting.
You can select your device mac with the command bluetoothctl I believe.
#! /bin/bash

rfkill unblock bluetooth

sleep 2
echo -e 'connect D4:9A:20:2E:B6:01' | bluetoothctl
sleep 5
if echo -e 'info' | bluetoothctl | grep -q 'Connected: yes' ; then
echo 'ok'
else
rfkill block bluetooth
fi

iamtheway
Level 1
Level 1
Posts: 19
Joined: Mon Apr 15, 2019 9:52 pm

Re: Automatically connect bluetooth device

Post by iamtheway »

Thanks for sharing your script.

There are not any native way? How this worked fine on ubuntu ?

Post Reply

Return to “Sound, Multimedia, & Codecs”