#!/usr/bin/env bash names=("chostybottombar" "chostytopbar") killall -q polybar while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done monitor=$(xrandr --query | grep "connected" | grep "primary" | cut -d" " -f1) for name in ${names[@]}; do MONITOR=${monitor} polybar -q --reload ${name} & done