diff options
author | Saren Arterius | 2019-04-28 00:28:52 +0800 |
---|---|---|
committer | Saren Arterius | 2019-04-28 00:28:52 +0800 |
commit | 61a0ea6744b66158d172c217de7058a06881f4de (patch) | |
tree | 189ab35f67c4bb2f94a1e39d971a80d1bc69b1c8 /bt-auto-enable-a2dp | |
parent | 962efd9042c5d4f49b138c2b2c51cbe8b18fa319 (diff) | |
download | aur-pulseaudio-bt-auto-enable-a2dp.tar.gz |
19
Diffstat (limited to 'bt-auto-enable-a2dp')
-rw-r--r-- | bt-auto-enable-a2dp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bt-auto-enable-a2dp b/bt-auto-enable-a2dp index 970343b72e65..dfa07ceb6b0a 100644 --- a/bt-auto-enable-a2dp +++ b/bt-auto-enable-a2dp @@ -16,7 +16,21 @@ function enable_a2dp() { expect -re \".*Device $mac ServicesResolved: yes\" " # enable card in pulseaudio - pactl set-card-profile $pulsecard a2dp_sink + a2dp_profiles=( + 'a2dp_sink_ldac' + 'a2dp_sink_aptx_hd' + 'a2dp_sink_aptx' + 'a2dp_sink_aac' + 'a2dp_sink_sbc' + 'a2dp_sink' ) + + for profile in "${a2dp_profiles[@]}" + do + if [[ `pactl list cards | grep ${profile}` ]]; then + pactl set-card-profile $pulsecard ${profile} && break + fi + done + logger -p info "mac $mac enabled" headsetname=`bt-device -l | perl -ne '/(.*) \('$mac'\)/ and print "$1\n"'` |