Easier way to connect to Bluetooth device

Solution 1:

Take a look at a similar question/answer here.

First, the MAC Address of the Bluetooth device is needed. You can find it by running the following commands:

  1. sudo systemctl start bluetooth
  2. bluetoothctl (a new bash prompt "[bluetooth]#" will be visible after running this command)
  3. devices
  4. Look for the MAC Address of your Bluetooth device by searching through the names of the device listed, assuming the device is powered on and visible.

Finally, run the following commands which start the Bluetooth service and passes the commands through the echo program. These two commands are what you need to connect to your bluetooth device over the terminal.

  1. sudo systemctl start bluetooth
  2. echo -e 'connect YOUR_DEVICE_MAC_ADDRESS \nquit' | bluetoothctl

This can be put in a bash script and the bash script can be automated to run upon startup.

Solution 2:

In addition to the CLI-based solutions in other answers, there is a Gnome extension called Bluetooth quick connect which streamlines the GUI a lot. It adds a toggle button to the Bluetooth menu for each paired device, which cuts your number of clicks down to three.

Screenshot of bluetooth-quick-connect extension

The easiest way to install Gnome extensions is to first install the Gnome extensions manager (apt install gnome-shell-extensions) and the Firefox plugin (which will be linked at the top of the extension's webpage). After that, installing any Gnome extension is just a case of clicking the toggle button at the top of the corresponding webpage.

Solution 3:

Created this simple script to toggle the bluetooth device.

#!/bin/bash

# run "bluetoothctl" to find the MAC address of your device.
MAC="AB:AB:AB:CD:CD:CD"

if hcitool con | grep -q "$MAC"
then
    echo -e "disconnect $MAC \nquit" | bluetoothctl
else
    echo -e "connect $MAC \nquit" | bluetoothctl
fi