Skip to content

Instantly share code, notes, and snippets.

@villeodell
Last active October 15, 2021 12:45
Show Gist options
  • Save villeodell/ddb1d34f7816d4292ee0acba2e4869ae to your computer and use it in GitHub Desktop.
Save villeodell/ddb1d34f7816d4292ee0acba2e4869ae to your computer and use it in GitHub Desktop.
Restart bluetooth from macOS Dock

Restart Bluetooth from macOS Dock

macOS has an annoying bug where bluetooth periodically stops working. If you're working via a BT keyboard/trackpad you are forced to wait a minute or two until it resolves on it's own.

Alternative (5 seconds): Have a cable at the ready, plugin your trackpad, restart BT via the macOS Dock.

Setup a shortcut to restart Bluetooth from the dock

Install blueutil

brew install blueutil

Create a .command file that will cycle bluetooth, make it executible, open in finder

echo "blueutil -p 0 && sleep 1 && blueutil -p 1" > btfix.command && chmod +x btfix.command && open .

Add a nice icon

  1. Select the .command file > right click > Get info (or CMD+I)
  2. Drag an icon file onto the existing icon in top left

Add to Dock

  1. Change .command to .app temporarily (icon disappears but it will come back)
  2. Drag to Dock
  3. Change .app extension back to .command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment