arch-rice/.config/polybar/launch.sh
2021-12-24 10:31:03 -05:00

37 lines
858 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 center &
polybar left &
elif [[ "${CURRENT_MONITOR_CONFIG}" -eq 5 ]];then
echo "Going with 5 for polybar"
polybar center &
polybar top &
elif [[ "${CURRENT_MONITOR_CONFIG}" -eq 6 ]];then
echo "Going with 6 for polybar"
polybar left &
polybar top &
elif [[ "${CURRENT_MONITOR_CONFIG}" -eq 7 ]];then
echo "Going with 7 for polybar"
polybar center &
polybar left &
polybar top &
else
echo "Going with default for polybar"
polybar example &
fi
echo "Polybar launched..."