Created
March 21, 2019 17:59
-
-
Save alana314/bffa2e6cdbf248f8c558ba6496dcc7ea to your computer and use it in GitHub Desktop.
Test if headphones are plugged in -- OS X shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if system_profiler SPAudioDataType | grep --quiet Headphones; then | |
echo plugged in | |
else | |
echo not plugged in | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment