Last active
April 17, 2020 11:54
-
-
Save jbruggem/e202d1719ce7b414448d56c8b7803f6a to your computer and use it in GitHub Desktop.
Disconnect / Reconnect bluetooth because there's a bug with WH-1000XM2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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