Is it possible to connect to AirPods Pro via keyboard shortcut?
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.
{
"title": "Bluetooth Connect",
"rules": [
{
"description": "Connect to AirPods",
"manipulators": [
{
"from": {
"key_code": "a",
"modifiers": {
"mandatory": ["fn"]
}
},
"to": [
{
"shell_command": "/usr/local/bin/blueutil -p 1; /usr/local/bin/blueutil --connect \"AirPods Pro\""
}
],
"type": "basic"
}
]
}
]
}
+ 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.