Skip to content

Commit

Permalink
Revert "Capture error cases involving invalid network device paths an…
Browse files Browse the repository at this point in the history
…d sleep before returning to resolve CPU consuming loop due to interval type of i3blocks. Addresses regolith-linux/regolith-desktop#532."

This reverts commit f7ae372.
  • Loading branch information
kgilmer committed Jan 10, 2021
1 parent f7ae372 commit 4d4944c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
11 changes: 0 additions & 11 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> Sun, 10 Jan 2021 11:25:46 -0800

regolith-i3xrocks-config (3.5.4-1) bionic; urgency=medium

[ Moritz Heiber ]
Expand Down
8 changes: 1 addition & 7 deletions scripts/net-traffic
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@

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

# some default values for arguments"
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
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
Expand Down

0 comments on commit 4d4944c

Please sign in to comment.