devices_amount=$(bluetoothctl devices | cut -f2 -d' ' | while read uuid; do bluetoothctl info $uuid; done|grep -e "Connected: yes" | wc -l)

if [ $devices_amount -gt 0 ]; then
  echo $devices_amount
else
  echo ""
fi

