Last active
November 11, 2019 15:25
-
-
Save Y-LyN-10/9ca97d85e33effa4c8f1fd830f823bd3 to your computer and use it in GitHub Desktop.
Toggle profiles of Bose35 headphones. When microphone is needed - use the "headset_head_unit", otherwise - use a2dp for high-quality audio.
This file contains hidden or 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/sh | |
HEADPHONES_NAME='Bose'; # Replace with your unique (or not so) device name | |
INDEX=`pacmd list-cards | grep -B5 -P $HEADPHONES_NAME | head -1 | awk '{print $2}'`; | |
pacmd list-cards | grep "active profile: <a2dp_sink>" | |
TOGGLE=$? | |
if [ $TOGGLE -eq 0 ]; then | |
pacmd set-card-profile $INDEX headset_head_unit | |
else | |
pacmd set-card-profile $INDEX a2dp_sink | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment