2021-12-06 17:37:34 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Terminate already running bar instances
|
|
|
|
killall -q polybar
|
|
|
|
|
2021-12-07 20:59:05 +01:00
|
|
|
# Restore config for i3
|
|
|
|
#cp -rfv ~/.config/polybar/config.i3 ~/.config/polybar/config
|
|
|
|
|
2021-12-06 17:37:34 +01:00
|
|
|
# Wait until the processes have been shut down
|
|
|
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
|
|
|
|
|
|
|
if type "xrandr"; then
|
|
|
|
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
2021-12-07 20:59:05 +01:00
|
|
|
MONITOR=$m polybar --reload mainbar-i3 -c ~/.config/polybar/config &
|
2021-12-06 17:37:34 +01:00
|
|
|
done
|
|
|
|
else
|
2021-12-07 20:59:05 +01:00
|
|
|
polybar --reload mainbar-i3 -c ~/.config/polybar/config &
|
2021-12-06 17:37:34 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Launch bar1 and bar2
|
|
|
|
#polybar example &
|
|
|
|
|
2021-12-07 20:59:05 +01:00
|
|
|
#echo "Bars launched..."
|