Skip to content

Instantly share code, notes, and snippets.

@third774
Last active November 1, 2023 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save third774/c6628d313cfcc004f628120ef4476b48 to your computer and use it in GitHub Desktop.
Save third774/c6628d313cfcc004f628120ef4476b48 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Connect to airpods
# @raycast.mode compact
# Optional parameters:
# @raycast.icon 🤖
# Documentation:
# @raycast.author Kevin Kipp
# @raycast.authorURL https://github.com/third774
#!/bin/bash
# Set the name of your AirPods Pro
airpods="Kevin's AirPods Pro"
SwitchAudioSource -a -t output
# Get the full name of the AirPods Pro audio device
airpods_device=$(SwitchAudioSource -a -t output | grep "$airpods" | sed 's/ (.*//')
echo $airpods_device
# Set AirPods Pro as the audio output device
SwitchAudioSource -s "$airpods_device"
sleep .2
open raycast://extensions/raycast/system/set-volume-to-50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment