I want to connect to my AirPods Pro on mac (Big Sur 11.1) using keyboard shortcut. I find it tedious to manually choose the top-right icon on the menu bar and click 'connect', but at the same time I don't want to make the pairing automatic since not always do I want to connect to my mac, such as while I play the music on my iPad.
So I want to connect to it via keyboard shortcut. Is it possible? It's fine to use 3rd-party apps such as Hammarspoon or Karabiner-Elements, though I could not find a way to connect to the AirPods.
Best Answer
Karabiner + Blueutil Solution
I do something like this using a bluetooth cli tool named blueutil. Here is a complex modification you could use in Karabiner.
+ Goku
Goku is a tool for more easily managing your karabiner configuration. I use this to manage mine. I have configured Karabiner to use F10 as a "audio layer"/modifier key for audio related mappings. If you learn a little about how Goku works, you can check out my configuration if you want to implement something like this for yourself.