summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO8
-rw-r--r--20-bt-auto-enable-a2dp.rules4
-rw-r--r--PKGBUILD6
-rw-r--r--bt-auto-enable-a2dp16
4 files changed, 25 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7aa8fb81e33..23541f0769f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = pulseaudio-bt-auto-enable-a2dp
pkgdesc = Udev service for temporary solve bug 92102 https://bugs.freedesktop.org/show_bug.cgi?id=92102
- pkgver = 15
- pkgrel = 2
+ pkgver = 19
+ pkgrel = 1
url = https://gist.github.com/EHfive/c4f1218a75f95b076f0387403246de78
arch = any
license = unknown
@@ -10,8 +10,8 @@ pkgbase = pulseaudio-bt-auto-enable-a2dp
depends = perl
source = 20-bt-auto-enable-a2dp.rules
source = bt-auto-enable-a2dp
- sha256sums = 2a7cf2b8570e75cabdc39ea50f6f9b49977e27bb75a48be9fb68a0af15cc0db5
- sha256sums = e36a9247bc3dd72899cc5a6ed12bbc4721f0472449acf27168a44c2af3e31544
+ sha256sums = 14a13177e3012f364d99264417c6792637e20e28a21ac03e697f5c2708e64f15
+ sha256sums = e37a779389144294fd42d7dcb97d825763e5abde8c1e93c189aa3b38bb65e006
pkgname = pulseaudio-bt-auto-enable-a2dp
diff --git a/20-bt-auto-enable-a2dp.rules b/20-bt-auto-enable-a2dp.rules
index 1af41715f46..5da1d9af04e 100644
--- a/20-bt-auto-enable-a2dp.rules
+++ b/20-bt-auto-enable-a2dp.rules
@@ -1 +1,3 @@
-SUBSYSTEM=="bluetooth", ACTION=="add", RUN+="/usr/local/bin/bt-auto-enable-a2dp" \ No newline at end of file
+# /etc/udev/rules.d/20-bt-auto-enable-a2dp.rules
+# hxss
+SUBSYSTEM=="bluetooth", ACTION=="add", RUN+="/home/replace-it/bt-auto-enable-a2dp.sh"
diff --git a/PKGBUILD b/PKGBUILD
index 2a783b4e1d7..4d3c0e88e61 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,14 @@
# Maintainer: saren@wtako.net
pkgname=pulseaudio-bt-auto-enable-a2dp
-pkgver=15
-pkgrel=2
+pkgver=19
+pkgrel=1
pkgdesc="Udev service for temporary solve bug 92102 https://bugs.freedesktop.org/show_bug.cgi?id=92102"
url="https://gist.github.com/EHfive/c4f1218a75f95b076f0387403246de78"
arch=(any)
license=('unknown')
depends=('bluez-tools' 'expect' 'perl')
source=('20-bt-auto-enable-a2dp.rules' 'bt-auto-enable-a2dp')
-sha256sums=('2a7cf2b8570e75cabdc39ea50f6f9b49977e27bb75a48be9fb68a0af15cc0db5' 'e36a9247bc3dd72899cc5a6ed12bbc4721f0472449acf27168a44c2af3e31544')
+sha256sums=('14a13177e3012f364d99264417c6792637e20e28a21ac03e697f5c2708e64f15' 'e37a779389144294fd42d7dcb97d825763e5abde8c1e93c189aa3b38bb65e006')
package() {
user=$(basename $HOME)
diff --git a/bt-auto-enable-a2dp b/bt-auto-enable-a2dp
index 970343b72e6..dfa07ceb6b0 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"'`