Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aleksandertabor/0da4f3099cfbafd303868a65691e7315 to your computer and use it in GitHub Desktop.
Save aleksandertabor/0da4f3099cfbafd303868a65691e7315 to your computer and use it in GitHub Desktop.
device_mac_address=XX-XX-XX
is_connected=$(/opt/homebrew/bin/blueutil --is-connected $device_mac_address)
if [[ "$is_connected" == 1 ]]; then
/opt/homebrew/bin/blueutil --disconnect $device_mac_address
else
/opt/homebrew/bin/blueutil --connect $device_mac_address
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment