Skip to content

Instantly share code, notes, and snippets.

@sandorkazi sandorkazi/.hs.sh
Last active Jul 8, 2018

Embed
What would you like to do?
bluetooth headset autoconfig
#!/bin/bash
ADDRESS=""
if [ "" != "${ADDRESS}" ]; then
echo ">>> RESTART bluetooth"
sudo systemctl restart bluetooth
sleep 2
echo -e "connect ${ADDRESS}\nexit\n" | bluetoothctl
sleep 4
DEVICE_ID=`pactl list cards short | grep "bluez_card.${ADDRESS//:/_}" | cut -f1`
pacmd set-card-profile ${DEVICE_ID} a2dp_sink
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.