diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-04-09 16:29:26 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-04-09 16:29:26 +0200 |
commit | a25681ae9407fa0cac13610eccf54550daf59465 (patch) | |
tree | 655e464279855ea1b4b50e2c3cf3ab8513abaa40 /i3blocks/i3internet.sh | |
parent | 6e1ce4f87831d3761a46497f80e56ac7a73e14c8 (diff) | |
download | scripts-a25681ae9407fa0cac13610eccf54550daf59465.tar.gz scripts-a25681ae9407fa0cac13610eccf54550daf59465.zip |
More information while connecting.
Diffstat (limited to 'i3blocks/i3internet.sh')
-rwxr-xr-x | i3blocks/i3internet.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/i3blocks/i3internet.sh b/i3blocks/i3internet.sh index edc4bef..a5b507e 100755 --- a/i3blocks/i3internet.sh +++ b/i3blocks/i3internet.sh @@ -12,8 +12,11 @@ ethDev="enp3s0" wstatus=$(cat /sys/class/net/$wifiDev/operstate) estatus=$(cat /sys/class/net/$ethDev/operstate) -if [ $wstatus = "down" ]; then +if [ "$wstatus" = "down" ]; then wifi="❌" +elif [ "$(nmcli | grep "$wifiDev: connecting ")" ]; then + step="$(nmcli | grep "$wifiDev: connecting " | sed 's/^.*(/(/;s/).*$/)/')" + wifi="⚙️ <span color='#fabd2f'>$(nmcli | grep "$wifiDev: " | cut -d' ' -f5-) $step</span>" else # with IP #wifi="✔️$(nmcli | grep "$wifiDev: connected to " | cut -d' ' -f4-) ($(ip addr show $wifiDev | grep "inet " | cut -d' ' -f6)) ($(grep "^\s*w" /proc/net/wireless | awk '{print int($3 * 100 / 70)"%"}'))" @@ -22,7 +25,7 @@ else fi if [ -z "$(nmcli | grep $ethDev)" ]; then en="❌❗ No $ethDev device found" -elif [ $estatus = "down" ]; then +elif [ "$estatus" = "down" ]; then en="❌" else # with IP |