From: Siraaj Khandkar Date: Tue, 3 Jul 2018 01:14:52 +0000 (-0400) Subject: Track lo IO rates in the conglomerate network section X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=6b2a0f950b7662bab9df8584b0e86080f0fb689a;p=khatus.git Track lo IO rates in the conglomerate network section --- diff --git a/bin/khatus_show b/bin/khatus_show index a872b6c..4545a1f 100755 --- a/bin/khatus_show +++ b/bin/khatus_show @@ -7,8 +7,6 @@ STATUS_DIR=$HOME/var/run/status STATUS_FILE__WIFI=$STATUS_DIR/wifi STATUS_FILE__ENERGY_NOTIFIED_BELLOW_HALF=$STATUS_DIR/notified_energy_bellow_half -SYMBOL_WIFI='📶' - #load=$(cat /proc/loadavg | awk '{printf "%4.2f %4.2f %4.2f", $1, $2, $3}') fan=$(awk '/^speed:/ {printf "%4d", $2}' /proc/acpi/ibm/fan) @@ -94,8 +92,8 @@ disk=$( printf("%s[%d%% %s]", direction, curr_perc, disk_io); }') -io_net=$( - awk ' +network=$( + awk -v wifi_conn=$(cat $STATUS_FILE__WIFI) ' BEGIN { bytes_per_unit = 1024 * 1024 } @@ -118,7 +116,14 @@ io_net=$( print curr_read > prev_read_file; print curr_write > prev_write_file; - printf("%s %0.3f▲ %0.3f▼\n", device, diff_write, diff_read); + devices[device] = sprintf("%0.3f▲ %0.3f▼", diff_write, diff_read); + } + + END { + lo = devices["lo"] + #eth = devices["enp0s25"] + wifi = devices["wlp3s0"] + printf("[%s | %s %s]", lo, wifi_conn, wifi) } ' /proc/net/dev ) @@ -187,8 +192,6 @@ volume_pactl=$( volume="[$volume_pactl]" -wifi=$(cat $STATUS_FILE__WIFI) - screen_brightness=$( max=$(cat /sys/class/backlight/acpi_video0/max_brightness) cur=$(cat /sys/class/backlight/acpi_video0/brightness) @@ -353,7 +356,7 @@ echo \ D$disk\ \ \ - $SYMBOL_WIFI [$wifi $(echo "$io_net" | awk '/^wlp3s0/ {print $2, $3}')]\ + N:$network\ \ \ B:$bluetooth_power\