From 2c7e1cd0bc39a2bd408f71fe53dedac1b3fad663 Mon Sep 17 00:00:00 2001 From: Kyle K Date: Thu, 29 Nov 2018 20:33:08 -0600 Subject: [PATCH] i3internet: strip leading whitespace from /proc/net/wireless output on my system 'grep ^w /proc/net/wireless' doesn't return a result due to leading space being present in front of wlo1 wifi iface: " wlo1: 0000 55. -55. -256 0 0 0 0 5" As a result the signal icon wasn't showing up. Solution is to strip it. Tested on T430s which was ok to begin with, no regression. --- .scripts/statusbar/i3internet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/statusbar/i3internet b/.scripts/statusbar/i3internet index dba6262..1538180 100755 --- a/.scripts/statusbar/i3internet +++ b/.scripts/statusbar/i3internet @@ -13,6 +13,6 @@ esac [ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" -[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep ^w /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') +[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') printf "%s %s" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/❎/;s/up/🌐/")"