Fix when networks are not connected in #polybar

This commit is contained in:
Colin Powell
2019-11-26 09:36:42 -05:00
parent 7b26647e1d
commit 5683da23d3
2 changed files with 15 additions and 16 deletions

View File

@ -4,6 +4,7 @@ pkill polybar
wlan=`/sbin/ifconfig | grep wlp | tail -1 | cut -d ':' -f 1`
eth=`/sbin/ifconfig | grep enx | tail -1 | cut -d ':' -f 1`
[[ -z "$eth" ]] && { eth=`/sbin/ifconfig | grep enp | tail -1 | cut -d ':' -f 1`; }
for m in $(polybar --list-monitors | cut -d":" -f1); do
WLAN=$wlan ETH=$eth MONITOR=$m polybar --reload primary &