dotfiles/config/polybar/launch.sh
Geoffrey Frogeye 694e8bffe3 New way of handling screens
Still not handled in workspace affectation though.
2017-07-06 21:53:33 +02:00

25 lines
506 B
Bash
Executable file

#!/usr/bin/env sh
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
# Launch bar for each display
primary=$(xrandr | grep primary | head -1 | cut -d' ' -f1)
polybar -m | cut -d':' -f1 | while read display
do
export display=$display
if [ "$display" == "$primary" ]
then
bar="primary"
else
bar="secondary"
fi
polybar $bar &
done
echo "Bars launched..."