Created
August 22, 2024 14:43
-
-
Save carcigenicate/02785c4426c48bed2511656b5578dbee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/env bash | |
# Attempts to set the mic profile to HFP since it randomly started defaulting to A2DP, which doesn't allow mic input | |
command="pacmd set-card-profile bluez_card.your_card handsfree_head_unit" | |
count=0 | |
maxCount=100 | |
output=$(eval $command) | |
while [[ ! -z "$output" ]] && [[ $count -lt maxCount ]] | |
do | |
sleep 0.5 | |
output=$(eval $command) | |
((count++)) | |
done | |
if [[ $count -eq $maxCount ]]; then | |
echo "Failed to enable mic after $maxCount tries" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment