diff options
| -rwxr-xr-x | .config/polybar/launch.sh | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh index 6b5c5db..64d7241 100755 --- a/.config/polybar/launch.sh +++ b/.config/polybar/launch.sh @@ -6,15 +6,24 @@ killall -q polybar # Wait until the processes have been shut down while pgrep -u "$UID" -x polybar >/dev/null; do sleep 1; done + # Launch bar -polybar left & -polybar right & -polybar middle & -#polybar tray & -#polybar xwindow & -#polybar top & +polybar top-left & +polybar top-middle-left & +polybar top-middle & +polybar top-middle-right & +polybar top-right & + +# Define bars per monitors +declare -A ARRANGEMENTS=(["$mainmonitor"]="top-left,top-middle-left,top-middle,top-middle-right,top-right" ["$secondmonitor"]="top-left,top-middle-left,top-middle,top-middle-right,top-right") -#sleep 5 && xdo raise -N "polybar-bottom_LVDS-1" & -if [[ $(xrandr -q | grep 'HDMI-1 connected') ]]: then - polybar top_external & -fi +# Each key +for MONITOR in "${!ARRANGEMENTS[@]}"; do + # split at `,` into array + while IFS=',' read -ra BARLIST; do + # for each bar (seperated by `,`) at current key + for BAR in "${BARLIST[@]}"; do + MONITOR="$MONITOR" polybar --reload "$BAR" & + done + done <<< "${ARRANGEMENTS[$MONITOR]}" +done |
