From 74c82adf7375fe68386211f42cd2203d842907a4 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 26 Oct 2022 00:58:56 +0200 Subject: [PATCH] Fix bt-menu --- bin/bt-menu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/bt-menu b/bin/bt-menu index 0219404..e28b451 100755 --- a/bin/bt-menu +++ b/bin/bt-menu @@ -9,12 +9,12 @@ bt_choice="" function get-bt-devices() { DEVICES=() IFS="\n" - for device in $(bluetoothctl devices); do - IFS=' ' - read -r ignore address name <<<"$(echo $device)" + while read -r device; do + address=${device:7:17} + name=${device:25} echo "$name - $address" DEVICES+=(["$name"]="$address") - done + done <<< "$(bluetoothctl devices)" } function bt-device-choice() {