This Raycast script command helps you to quickly connect to your AirPods using a minmal wrapper around the BluetoothConnector utillity.
-
Install the
BluetoothConnector
utility using Homebrew:brew install bluetoothconnector
Make sure to have
brew
installed. This will install the latest version ofBluetoothConnector
. -
Clone this repository.
git clone https://github.com/mikeoertli/raycast-airpods-connector.git
It is recommended to have
HOMEBREW_PREFIX
defined, for M1 Macs this will be/opt/homebrew/
. It should be defined as:export HOMEBREW_PREFIX=$(brew --prefix)
-
Create a configuration file (
<raycast-airpods-connector clone dir>/airpods-mac.conf
) within the cloned directory (git
ignores this file).-
This config file should contain only the MAC address of your AirPods.
-
This config file is used to export an enviornment variable with the following, so ensure there is nothing else in it, including newlines or other content.
-
The MAC can use either no separator or a "
-
" separator, butBluetoothConnector
does NOT work with a colon (:
)-separated string. In other words, these are fine:>cat airpods-mac.conf aabbccddeeff >cat airpods-mac.conf aa-bb-cc-dd-ee-ff
-
-
Install into Raycast by adding this directory as a script directory in Raycast.
Unlike the my tweak to the original AirPods Connector for Alfred, this doesn't let you select your AirPods via the GUI, that may be something that gets added someday, but it isn't a high priority.
Make sure to install the latest version of BluetoothConnector
:
brew update && brew upgrade bluetoothconnector
PRs welcome!
This borrows from the Afred variant, which in turn borrows from others.