arch-rice/.config/bspwm/launch.sh

37 lines
891 B
Bash
Executable File

#!/bin/bash
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been killed
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
CURRENT_MONITOR_CONFIG=${1:-7}
# Launch Polybar using default config location
# ~/.config/polybar/config
if [[ "${CURRENT_MONITOR_CONFIG}" -eq 4 ]];then
echo "Going with 4 for polybar"
polybar primary &
polybar secondary &
elif [[ "${CURRENT_MONITOR_CONFIG}" -eq 5 ]];then
echo "Going with 5 for polybar"
polybar primary &
polybar tertiary &
elif [[ "${CURRENT_MONITOR_CONFIG}" -eq 6 ]];then
echo "Going with 6 for polybar"
polybar secondary &
polybar tertiary &
elif [[ "${CURRENT_MONITOR_CONFIG}" -eq 7 ]];then
echo "Going with 7 for polybar"
polybar primary &
polybar secondary &
polybar tertiary &
else
echo "Going with default for polybar"
polybar example &
fi
echo "Polybar launched..."