summaryrefslogblamecommitdiff
path: root/i3blocks-net.sh
blob: 3d65ddb986fc7f9ef05f88c0f83cf5eb689962d6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
         
                  




                                                         
                                         

                                                          
                                           
  
#!/bin/sh
icon_ethernet=󰈀
icon_wireless=󰖩

is_ethernet=$(ifconfig em0 | grep status | cut -d':' -f2)
if [ "$is_ethernet" = " active" ]; then
	inet=$(ifconfig lagg0 | grep inet\ | cut -w -f3)
	printf "$icon_ethernet%s\n" $inet
else
	ssid=$(ifconfig wlan0 | grep ssid | cut -d'"' -f2)
	printf "$icon_wireless%s\n" "$ssid"
fi