Polybar: Tighten up launch script

This commit is contained in:
Salt 2019-07-11 17:29:10 -05:00
parent 68cde74a8b
commit 380a132519

View File

@ -47,12 +47,10 @@ step_spawn_primary() {
step_spawn_secondary() { step_spawn_secondary() {
# Spawn more for each secondary # Spawn more for each secondary
log "Spawning secondary bars" log "Spawning secondary bars"
export secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}') local secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}')
if [ "$secondary_monitors" == "" ]; then [ -z "$secondary_monitors" ] && return 0
return 0
fi
for monitor in $secondary_monitors; do for monitor in $secondary_monitors; do
PB_MONITOR=$monitor export PB_MONITOR=$monitor
polybar -r secondary & polybar -r secondary &
polybar -r secondary-2 & polybar -r secondary-2 &
done done