From 90fcda188d8ea45fb038681729ceb94ca4d3bce0 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Sat, 22 Aug 2020 16:38:08 +0200 Subject: [PATCH] [polybar] Fix network_usage garbage output --- .config/polybar/scripts/network_usage | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/polybar/scripts/network_usage b/.config/polybar/scripts/network_usage index b417aae..07dfbbd 100755 --- a/.config/polybar/scripts/network_usage +++ b/.config/polybar/scripts/network_usage @@ -47,7 +47,8 @@ while true; do bits_in=$((((current_bytes_in-last_value_in) / REFRESH) * 8)) bits_out=$((((current_bytes_out-last_value_out) / REFRESH) * 8)) - output=$(LANG=C numfmt --to iec --format "%8.2f" -z "$bits_in" "$bits_out" 2>/dev/null) + output=$(LANG=C numfmt --to iec --format "%8.2f" "$bits_in" "$bits_out" \ + | tr -d "\n" 2>/dev/null) if ! echo "$output" | grep -qE '[0-9]{1,3}\.[0-9]{1,3}([K,M,G,B])?$'; then output=" 0.01 0.01"