From ad3005b3eaf3df8f50cb9b984a1970019b3cfe14 Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Sat, 9 Jun 2018 12:29:19 +0200 Subject: [PATCH] Show polybar only under on screen --- .config/polybar/scripts/launch_polybar.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/polybar/scripts/launch_polybar.sh b/.config/polybar/scripts/launch_polybar.sh index b50e2c8..12bd37a 100755 --- a/.config/polybar/scripts/launch_polybar.sh +++ b/.config/polybar/scripts/launch_polybar.sh @@ -4,10 +4,10 @@ names=("chostybottombar" "chostytopbar") killall -q polybar while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done if type "xrandr"; then - for monitor in $(xrandr --query | grep " connected" | cut -d" " -f1); do - for name in ${names[@]}; do - MONITOR=${monitor} polybar -q --reload ${name} & - done + monitors=$(xrandr --query | grep " connected" | cut -d" " -f1) + monarray=($monitors) + for name in ${names[@]}; do + MONITOR=${monarray[1]} polybar -q --reload ${name} & done else polybar --reload ${name} &