This repository has been archived on 2026-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dotfiles-inist/polybar/launch.sh
2023-10-09 14:35:45 +02:00

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..."