18 lines
519 B
Bash
Executable File
18 lines
519 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Terminate already running bar instances
|
|
killall -q polybar
|
|
|
|
# Wait until the processes have been shut down
|
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
|
|
|
primary=$(xrandr | awk '/ primary / {print $1}')
|
|
# Launch Polybar, using default config location ~/.config/polybar/config
|
|
for m in $(polybar -m | cut -d":" -f1); do
|
|
bar="secondary";
|
|
if [ "$m" = "$primary" ]; then bar="primary"; fi
|
|
MONITOR=$m polybar -r $bar &
|
|
MONITOR=$m polybar -r top &
|
|
done
|
|
|
|
echo "Polybar launched..." |