summaryrefslogtreecommitdiff
path: root/i3blocks-net.sh
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-05-14 17:35:21 -0400
committerAdam T. Carpenter <atc@53hor.net>2020-05-14 17:35:21 -0400
commit680a167d6f72853eeab01970426028fc474c6005 (patch)
tree8125abf3f5cc3ccb7c7ec8960854ab3992d3ae21 /i3blocks-net.sh
parenta9ca605132e22b5bb7ab1bf67ebbcfa1e0a0c0d2 (diff)
downloadscripts-680a167d6f72853eeab01970426028fc474c6005.tar.xz
scripts-680a167d6f72853eeab01970426028fc474c6005.zip
added net, updated audio for FreeBSD, removed title blocks
Diffstat (limited to 'i3blocks-net.sh')
-rwxr-xr-xi3blocks-net.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/i3blocks-net.sh b/i3blocks-net.sh
new file mode 100755
index 0000000..8690cb9
--- /dev/null
+++ b/i3blocks-net.sh
@@ -0,0 +1,12 @@
+#!/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