From 1ca0626b5b2cc1e01f8a0bd7c91fa07bd0bfdf6e Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Sat, 7 Jul 2018 17:01:19 -0400 Subject: [PATCH] Hide wifi IO rates when disconnected --- bin/khatus_show | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/khatus_show b/bin/khatus_show index 537475b..935a1da 100755 --- a/bin/khatus_show +++ b/bin/khatus_show @@ -120,10 +120,15 @@ network=$( } END { - lo = devices["lo"] - #eth = devices["enp0s25"] - wifi = devices["wlp3s0"] - printf("[%s | %s %s]", lo, wifi_conn, wifi) + lo = devices["lo"] + #eth = devices["enp0s25"] + wifi_io = devices["wlp3s0"] + if (wifi_conn == "--") { + wifi = wifi_conn + } else { + wifi = wifi_conn " " wifi_io + } + printf("[%s | %s]", lo, wifi) } ' /proc/net/dev ) -- 2.20.1