From 60d25abab0dcb0221be0c3b9056b95d914102605 Mon Sep 17 00:00:00 2001 From: Vlad Doster Date: Mon, 9 Mar 2020 20:04:04 -0400 Subject: [PATCH] Updated polybar script --- .local/bin/launch_polybar | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.local/bin/launch_polybar b/.local/bin/launch_polybar index 20b1029a..77b9b211 100755 --- a/.local/bin/launch_polybar +++ b/.local/bin/launch_polybar @@ -3,12 +3,9 @@ # Terminate already running bar instances killall -q polybar -if type "xrandr"; then - for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do - MONITOR=$m polybar --reload main & - done -else - polybar --reload main & -fi +# Wait until the processes have been shut down +while pgrep -x polybar >/dev/null; do sleep 1; done -echo "Bars launched..." +for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar main & done + +echo "Bars launched..." \ No newline at end of file