summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xi3blocks-net.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/i3blocks-net.sh b/i3blocks-net.sh
index 340a70a..d0a87a4 100755
--- a/i3blocks-net.sh
+++ b/i3blocks-net.sh
@@ -4,12 +4,12 @@ icon_down=󰈂
icon_wireless=󰖩
is_ethernet=$(ifconfig em0 | grep status | cut -d\: -f2)
-inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3)
+inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3 | tr '\n' ' ')
if [ "$is_ethernet" = " active" ]; then
- printf "%s%s" $icon_ethernet $inet
+ printf "%s%s" $icon_ethernet "$inet"
elif [ "$(ifconfig wlan0 | grep status | cut -d\: -f2)" = " associated" ]; then
ssid=$(ifconfig wlan0 | sed -n 's/^.*ssid \(.*\) channel.*$/\1/p')
- [ -n "$ssid" ] && printf "%s%s %s" $icon_wireless "$ssid" $inet
+ [ -n "$ssid" ] && printf "%s%s %s" $icon_wireless "$ssid" "$inet"
else
printf "%sOffline" $icon_down
fi