Linux: Toggle bluetooth codec script

This commit is contained in:
Joseph Ferano 2024-08-10 12:21:10 +07:00
parent 7aee366e41
commit 14e0ebf3d6

14
.local/scripts/toggle-bt-codec Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
ldac=`pactl list | grep Active | grep a2dp-sink-sbc`
card=`pactl list | grep "Name: bluez_card." | cut -d ' ' -f 2`
if [ -n "$ldac" ]; then
echo "Switching $card to msbc..."
pactl set-card-profile $card headset-head-unit-msbc
echo "...done"
else
echo "Switching $card to ldac..."
pactl set-card-profile $card a2dp-sink-sbc
echo "...done"
fi