Skip to content

Instantly share code, notes, and snippets.

@PieGuy314
Last active December 2, 2023 12:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PieGuy314/6da5eb2b074bbab4301ab487a3218bb3 to your computer and use it in GitHub Desktop.
Save PieGuy314/6da5eb2b074bbab4301ab487a3218bb3 to your computer and use it in GitHub Desktop.
Update/Create ALSA config file with updated BD_ADDR
#!/bin/sh
#
# Update alsa config file with new BD_ADDR
# Backup original
# Create a new config file if one doesn't exist
usage() {
echo "Usage: $0 xx:xx:xx:xx:xx:xx"
}
[ $# -ne 1 ] && usage && exit 1
RC=~/.asoundrc
[ -f ${RC} ] && sed -i.orig '/^defaults.bluealsa.device/s/".*"/"'${1}'"/g' ${RC} || cat > ${RC} <<EOF
defaults.bluealsa.interface "hci0"
defaults.bluealsa.device "${1}"
defaults.bluealsa.profile "a2dp"
defaults.bluealsa.delay 10000
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment