Files
dotfiles/.config/polybar/launch.sh
2021-11-21 21:07:53 +01:00

20 lines
416 B
Bash

#!/usr/bin/env sh
# Terminate already running bar instances
killall -q polybar
readonly MAINSCREEN="eDP1"
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
# Launch polybar
MONITOR="${MAINSCREEN}" polybar main &
for m in $(polybar --list-monitors | cut -d":" -f1); do
if [ ${m} != "${MAINSCREEN}" ]; then
MONITOR=$m polybar --reload main &
fi
done