diff --git a/functions/bluetooth b/functions/bluetooth index 449be4f..129039e 100755 --- a/functions/bluetooth +++ b/functions/bluetooth @@ -1,4 +1,16 @@ #!/bin/sh bssid="$(bluetoothctl devices | dmenu -p "Devices: " -l 20 | cut -d' ' -f2)" -bluetoothctl connect "$bssid" + +exit_counter=0 +until bluetoothctl connect "$bssid" +do + ((exit_counter+=1)) + + if [ "$exit_counter" -gt 3 ]; then + break + else + echo ... + sleep 1 + fi +done