This is a collection of dotfiles and scripts for my bspwm setup
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
302 B

#!/bin/sh
ICON=""
WIRED="${1:-eth0}"
COLOR="-"
if [ ! -d /sys/class/net/${WIRED} ] ||
[ "$(cat /sys/class/net/$WIRED/operstate)" = 'down' ] ||
[ "$(ip a | grep $WIRED | awk '/inet / {print $2}')" = "" ]; then
COLOR="$COLOR7"
else
COLOR="$COLOR15"
fi
printf "%s\n" "iface%{F$COLOR}$ICON%{F-}"