Skip to content

Instantly share code, notes, and snippets.

@jbruggem
Last active April 17, 2020 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jbruggem/e202d1719ce7b414448d56c8b7803f6a to your computer and use it in GitHub Desktop.
Save jbruggem/e202d1719ce7b414448d56c8b7803f6a to your computer and use it in GitHub Desktop.
Disconnect / Reconnect bluetooth because there's a bug with WH-1000XM2
#!/usr/bin/expect -f
set prompt "#"
set address [lindex $argv 0]
spawn bluetoothctl
expect -re $prompt
send "disconnect $address\r"
expect "Successful disconnected"
expect -re $prompt
send "connect $address\r"
expect "Successful connected"
expect -re $prompt
send "quit\r"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment