I found this script somewhere from here. It uses pulseaudio commandline and disconnects bluetooth headphones and reconnects them using a2dp sink. Save it as .sh and chmod +x filename.sh
I used desktop shortcut to execute it.
pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` off; sleep 2 ; echo -e "disconnect 50:C9:71:97:A1:86\n quit"|bluetoothctl;sleep 5; echo -e "connect 50:C9:71:97:A1:86\n quit"|bluetoothctl; sleep 5; pacmd set-card-profile `pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}'` a2dp_sink
You could play with bluetoothctl
in terminal and try what you can do with it. Same thing with pulseaudio using command pacmd
.