I have a script, and I want it to behave differently if headphones are connected. How can I get this information?
I tried using SwitchAudioSource, but its output is the same, whether or not the headphones are connected:
~/tmp❯ SwitchAudioSource -cBuilt-in Output~/tmp❯ SwitchAudioSource -aBuilt-in Microphone (input)Background Music (input)Background Music (UI Sounds) (input)Built-in Output (output)Background Music (output)Background Music (UI Sounds) (output)