Dotfiles/polybar/scripts/launch.sh

18 lines
403 B
Bash
Executable file

#!/bin/bash
killall -q polybar
restack_list=('' 'i3' '')
i=0
while read bar; do
if [[ $i -eq 0 ]]; then
# Launch Main Bar
MONITOR=$bar polybar main 2>&1 | tee -a /tmp/polybar_$bar.log & disown
else
# Launch Sub Bar
MONITOR=$bar RESTACK=${restack_list[$i]} polybar workspaces 2>&1 | tee -a /tmp/polybar_$bar.log & disown
fi
i=$((i + 1))
done < <(polybar -M | cut -d ':' -f 1)