From cb871f27fca2832558973ee4873b751104f50d2b Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Sun, 17 May 2015 12:31:03 -0700 Subject: [PATCH] Patch lemonbar final_bar.sh to work in zsh --- scripts/lemonbar/final_bar.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/lemonbar/final_bar.sh b/scripts/lemonbar/final_bar.sh index ac27e3c..9a0cf2b 100755 --- a/scripts/lemonbar/final_bar.sh +++ b/scripts/lemonbar/final_bar.sh @@ -30,7 +30,7 @@ memused() { } network() { - read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'` + read -d '' lo int1 int2 <<< $(ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p') if iwconfig $int1 >/dev/null 2>&1; then wifi=$int1 eth0=$int2 @@ -38,7 +38,10 @@ network() { wifi=$int2 eth0=$int1 fi - ip link show $eth0 | grep 'state UP' >/dev/null && int=$eth0 ||int=$wifi + ip link show $eth0 | grep 'state UP' >/dev/null && int=$eth0 || int=$wifi + + ping -c 1 8.8.8.8 >/dev/null 2>&1 && + echo "$int connected" || echo "$int disconnected" #int=eth0