You are not logged in.
It's been a while since I have used my bluetooth mouse. With bluez 4 I had a script with "hidd -search" which I ran after plugging in my bluetooth USB dongle and having set my mouse in discovery mode. Now I can do all this stuff manually in bluetoothctl, but how do I automate it? I'd like to have a script doing it or better yet a .conf file where I can put the mac address of my mouse and instruct to automatically connect to it when it sees it
sorry if it's a dumb question but I haven't found anything around
Last edited by Nareto (2013-10-10 12:54:43)
Offline
Have you read https://wiki.archlinux.org/index.php/Bluetooth , https://wiki.archlinux.org/index.php/Bluetooth_Mouse and https://wiki.archlinux.org/index.php/Bl … figuration ?
Maybe there's something in there that would help you.
Offline
the first two I had seen, the last no. The last seems to interact directly with dbus... it honestly though seems too long a procedure, I'll probably just install a graphical utility to manage it for me
Offline
After some hours of testing I have been able to automate the process with bluetoothctl.
You have to pass with echo (with option -e) the commands you want to execute. Every command you have to terminate it with a new line (\n). When I do connect I use the tab (\t) so that I do not need to update the script with the MAC of my keyboard.
#!/bin/bash
# enable bluetooth
sudo systemctl start bluetooth
sleep 1
# run the program bluez
echo -e 'power on\nconnect \t \nquit' | bluetoothctl
Offline