From 4d4944cba58b3a00b58f80e1663a6393d94d58f8 Mon Sep 17 00:00:00 2001 From: Ken Gilmer Date: Sun, 10 Jan 2021 11:28:35 -0800 Subject: [PATCH] Revert "Capture error cases involving invalid network device paths and sleep before returning to resolve CPU consuming loop due to interval type of i3blocks. Addresses https://github.com/regolith-linux/regolith-desktop/issues/532." This reverts commit f7ae3726ee853b95275c3c900df1d7c947e20724. --- debian/changelog | 11 ----------- scripts/net-traffic | 8 +------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/debian/changelog b/debian/changelog index 311f1e7..895a954 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,3 @@ -regolith-i3xrocks-config (3.5.5-1ubuntu1) bionic; urgency=medium - - [ Moritz Heiber ] - * Added gawk specific testing for temp script (#108) - * Filter all interfaces associated with VPN traffic while determining default route (#110) - - [ Ken Gilmer ] - * Capture error cases involving invalid network device paths and sleep before returning to resolve CPU consuming loop due to interval type of i3blocks. Addresses https://github.com/regolith-linux/regolith-desktop/issues/532. - - -- Regolith Linux Sun, 10 Jan 2021 11:25:46 -0800 - regolith-i3xrocks-config (3.5.4-1) bionic; urgency=medium [ Moritz Heiber ] diff --git a/scripts/net-traffic b/scripts/net-traffic index a0d2cad..f905d22 100755 --- a/scripts/net-traffic +++ b/scripts/net-traffic @@ -2,7 +2,6 @@ set -Eeu -o pipefail -set -x # Note: net-traffic uses interval type 'repeat' so cannot use button events. # See https://github.com/vivien/i3blocks#interval @@ -10,7 +9,6 @@ set -x UP=${label_icon:-$(xrescat i3xrocks.label.up " up")} DN=${label_icon:-$(xrescat i3xrocks.label.dn " dn")} DLY=${DLY:-5} -ERROR_DLY=${ERROR_DLY:-10} RT=${RT:-} # Padding the output to 5 characters to avoid jittering on the bar @@ -18,14 +16,10 @@ NUMFMT="numfmt --to iec --format %f --padding 5" # determine the net interface name IF="${BLOCK_INSTANCE:-$(ip route show default | awk '!/(ppp|tun|tap)/ { print $5 }')}" +[ "$IF" = "" ] && exit IF_PATH="/sys/class/net/${IF}" -if [[ "$IF" == "" || ! -d "$IF_PATH" || ! -f "${IF_PATH}"/statistics/rx_bytes || ! -f "${IF_PATH}"/statistics/tx_bytes ]]; then - sleep "${ERROR_DLY}" - exit 1 -fi - if [ -d "${IF_PATH}/wireless" ]; then NIC=${label_icon:-$(xrescat i3xrocks.label.wifi )} else