Created
April 13, 2022 07:23
-
-
Save arjan/8cd04a14a8b9f7267540b69d20f33e0d to your computer and use it in GitHub Desktop.
Sony WH-1000X bluetooth profile switcher
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 | |
set -e | |
CARD=$(pactl list | grep bluez_card | awk -F ': ' '{print $2}') | |
A=a2dp-sink-ldac | |
B=headset-head-unit | |
PROFILE=$(pactl list |grep 'Active Profile' | tail -n 1 | awk -F': ' '{print $2}') | |
if [ "$PROFILE" = "$A" ]; then | |
TARGET=$B | |
else | |
TARGET=$A | |
fi | |
echo "$PROFILE -> $TARGET" | |
notify-send "Audio profile: $TARGET" | |
pactl set-card-profile "$CARD" "$TARGET" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment