Dotfiles/polybar/scripts/launch.sh

19 lines
403 B
Bash
Raw Permalink Normal View History

2023-02-03 18:12:16 +00:00
#!/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)