From 7732da3905ccae725e871d61962ecc6cd0f75da7 Mon Sep 17 00:00:00 2001 From: "jonathan.wyss" Date: Wed, 10 Sep 2025 10:41:18 +0200 Subject: [PATCH] switch module for technics bt headphone --- bt-a2dp-hfp-switch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bt-a2dp-hfp-switch diff --git a/bt-a2dp-hfp-switch b/bt-a2dp-hfp-switch new file mode 100755 index 0000000..339e695 --- /dev/null +++ b/bt-a2dp-hfp-switch @@ -0,0 +1,14 @@ +#!/bin/bash + +a2dp=`pactl list | grep Active | grep a2dp_sink` +card=`pactl list | grep "Name: bluez_card." | cut -d ' ' -f 2` + +if [ -n "$a2dp" ]; then + echo "Switching $card to handsfree..." + pactl set-card-profile $card handsfree_head_unit + echo "...done" +else + echo "Switching $card to a2dp..." + pactl set-card-profile $card a2dp_sink + echo "...done" +fi