diff --git a/blocks-internet b/blocks-internet index 1f7bfc1..03e7228 100644 --- a/blocks-internet +++ b/blocks-internet @@ -1 +1,3 @@ -nmcli -t -f active,ssid dev wifi | grep -E 'yes' | cut -c 5- | grep . || (mmcli -m /org/freedesktop/ModemManager1/Modem/0 | grep "operator name:" | cut -c 38- | tr -d '\n' && echo -n ": " && mmcli -m /org/freedesktop/ModemManager1/Modem/0 | grep -P "\d+%" -o) || echo "Disconnected" +modem=$(mmcli -L | grep -P "/org/freedesktop/.+\d" -m 1 -o) + +nmcli -t -f active,ssid dev wifi | grep -E 'yes' | cut -c 5- | grep . || (mmcli -m $modem | grep "operator name:" | cut -c 38- | tr -d '\n' && mmcli -m $modem | grep -P " \d+%" -o) || echo "Disconnected"