Skip to content

Instantly share code, notes, and snippets.

@annarailton
Created July 9, 2019 07:37
Show Gist options
  • Save annarailton/ec5b47c9df80ec211fcdb5f34bf79ecf to your computer and use it in GitHub Desktop.
Save annarailton/ec5b47c9df80ec211fcdb5f34bf79ecf to your computer and use it in GitHub Desktop.
A2DP sink on bluetooth headphones + Ubuntu
# Hack job script to get correct audio profile on my bluetooth headphones
# Replace DEVICE_ID with your device's ID
# From https://askubuntu.com/a/773391
DEVICE_ID="04:5D:4B:DE:CF:8E"
pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` off; sleep 2 ; echo -e "disconnect $DEVICE_ID\n quit"|bluetoothctl;sleep 5; echo -e "connect $DEVICE_ID\n quit"|bluetoothctl; sleep 5; pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` a2dp_sink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment