From e5b8a1e1f02ca53e60e91f7e23698df4600b10c9 Mon Sep 17 00:00:00 2001 From: aj Date: Fri, 22 Mar 2019 19:35:45 +0000 Subject: [PATCH] some dynamism in iface --- polybar/config | 2 +- polybar/launch.sh | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/polybar/config b/polybar/config index 456ec3f..4ab2e34 100644 --- a/polybar/config +++ b/polybar/config @@ -143,7 +143,7 @@ ws-icon-9 = 100:spotify; [module/internalip] type = internal/network -interface = wlp3s0 +interface = ${env:IFACE:} interval = 5 ;udspeed-minwidth = 0 diff --git a/polybar/launch.sh b/polybar/launch.sh index bca5a03..b0ee229 100755 --- a/polybar/launch.sh +++ b/polybar/launch.sh @@ -9,8 +9,16 @@ while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done # Launch bar1 and bar2 #polybar top & -for m in $(polybar --list-monitors | cut -d":" -f1); do - MONITOR=$m polybar --reload top & -done +if [[ "$(hostname)" == "andy-pc" ]]; then + for m in $(polybar --list-monitors | cut -d":" -f1); do + MONITOR=$m IFACE="eno1" polybar --reload top & + done +else + for m in $(polybar --list-monitors | cut -d":" -f1); do + MONITOR=$m IFACE="wlp3s0" polybar --reload top & + done +fi + + echo "Bars launched..."