Skip to content

Instantly share code, notes, and snippets.

@marisancans
Created November 2, 2021 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marisancans/a8e61ccc8251ddd6191638e06438f0ec to your computer and use it in GitHub Desktop.
Save marisancans/a8e61ccc8251ddd6191638e06438f0ec to your computer and use it in GitHub Desktop.
Automatic bluetooth connecting and pairing on linux
# Install bluez tools
# sudo apt-get install -y bluez-tools
# timeout 10 means it will scan the devices for 10 seconds
BT_DEVICE=08:07:20:73:63:2A
bt-device -l
bt-device -r ${BT_DEVICE}
timeout 10 bt-adapter -d
bt-device --set ${BT_DEVICE} Trusted true
bt-device -c ${BT_DEVICE}
bluetoothctl connect ${BT_DEVICE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment