Merge pull request #152 from fatalhalt/master

i3internet: strip leading whitespace from /proc/net/wireless output
This commit is contained in:
Luke Smith 2018-11-30 09:33:15 -05:00 committed by GitHub
commit 2cc57b101f

View file

@ -13,6 +13,6 @@ esac
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" [ "$(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/🌐/")" printf "%s %s" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/❎/;s/up/🌐/")"