bar1=" "
bar2=" "
bar3=" "
bar4=" "
bar5=" "

output=$(mmcli -m ANY)

signal=$(echo "$output" | grep -oP '(?<=signal quality: ).*(?=\%)')

if [[ signal -lt 20 ]]; then
  echo -n "$bar1"
elif [[ signal -lt 20 ]]; then
  echo -n "$bar1"
elif [[ signal -lt 40 ]]; then
  echo -n "$bar2"
elif [[ signal -lt 60 ]]; then
  echo -n "$bar3"
elif [[ signal -lt 80 ]]; then
  echo -n "$bar4"
else
  echo -n "$bar5"
fi

echo "$output" | grep -oP '(?<=state: ).*' | cat | head -n 1 | tr -d '\n' | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"
echo -n ' / '
echo "$output" | grep -oP '(?<=operator name: ).*' | tr -d '\n'
echo -n ' / '
echo "$output" | grep -oP '(?<=access tech: ).*' | tr [a-z] [A-Z] | tr -d '\n'
echo
