2019-01-10 10:45:52 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
names=("chostybottombar" "chostytopbar")
|
|
|
|
killall -q polybar
|
|
|
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
|
|
|
if type "xrandr"; then
|
2019-01-14 15:44:04 +01:00
|
|
|
monitors=$(xrandr --query | grep " connected" | cut -d" " -f1)
|
|
|
|
monarray=($monitors)
|
2019-01-10 10:45:52 +01:00
|
|
|
for name in ${names[@]}; do
|
2019-01-14 15:44:04 +01:00
|
|
|
for mon in ${monarray[@]}; do
|
|
|
|
MONITOR=${mon} polybar -q --reload ${name} &
|
|
|
|
done
|
|
|
|
done
|
2019-01-10 10:45:52 +01:00
|
|
|
else
|
2019-01-14 15:44:04 +01:00
|
|
|
polybar --reload ${name} &
|
2019-01-10 10:45:52 +01:00
|
|
|
fi
|