1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-14 00:32:28 +00:00
dotfiles/scripts/.bin/polybar.sh
J. Fernando Sánchez d1067cbb00 Fix polybar.sh
After the last update, I started getting duplicated bars when using cloned
monitors.

This commit changes the polybar.sh script to use replace xrandr with a call to
`polybar --list-monitors`, which ignores cloned monitors by default.
2020-12-28 14:58:16 +01:00

14 lines
312 B
Bash
Executable File

#!/bin/sh
# 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
for m in $(polybar --list-monitors | cut -d":" -f1); do
MONITOR=$m polybar --reload main &
done
polybar --reload main &
fi