From d8fc41b9ccb4a42d1a2f6bf584f6b36103207d04 Mon Sep 17 00:00:00 2001 From: natemaia Date: Tue, 5 Dec 2017 20:58:10 -0800 Subject: [PATCH] Fix up some minor issues in user scripts --- home/bin/start-polybar | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/home/bin/start-polybar b/home/bin/start-polybar index 92d0ecb0..4ef4f4a3 100755 --- a/home/bin/start-polybar +++ b/home/bin/start-polybar @@ -24,24 +24,26 @@ if [[ $1 == "--reload" ]] && [[ $CUR_WM == "openbox" ]]; then al-compositor --restart al-tint2restart elif [[ $1 == "--reload" ]]; then - echo "[WARN]: Option [--reload] is meant for Openbox Only" + echo "[WARN]: Option [--reload] is meant for Openbox..." fi # Drop out if tint2 is running if pgrep tint2 >/dev/null; then - echo "Tint2 is running... Exiting" - exit 0 + echo "Tint is running... Exiting" + exit 0 +else + # Terminate already running Bars + while pgrep polybar >/dev/null; do + pkill polybar + sleep 0.5 + done + + # Launch each bar in BARS=() above + echo "Using $CUR_WM... Launching Bars" + for bar in "${BARS[@]}"; do + polybar -r --config=$CONFIG ${CUR_WM}-$bar & + done + echo "Bars launched..." fi -# Terminate already running Bars -while pgrep polybar >/dev/null; do - killall -q polybar - sleep 0.5 -done -# Launch each bar in BARS=() above -echo "Using $CUR_WM... Launching Bars" -for bar in "${BARS[@]}"; do - polybar -r --config=$CONFIG ${CUR_WM}-$bar & -done -echo "Bars launched..."