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() {
# Spawn more for each secondary
log "Spawning secondary bars"
export secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}')
if [ "$secondary_monitors" == "" ]; then
return 0
fi
local secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}')
[ -z "$secondary_monitors" ] && return 0
for monitor in $secondary_monitors; do
PB_MONITOR=$monitor
export PB_MONITOR=$monitor
polybar -r secondary &
polybar -r secondary-2 &
done