From 71da49fab712a47a7969f70c6a29a4bc4b6d5a03 Mon Sep 17 00:00:00 2001 From: "Archie Hilton (thytom)" Date: Mon, 4 Nov 2019 09:21:40 +0000 Subject: [PATCH] Internet is off on startup. Cleaned up bar.sh and config --- bar.sh | 22 ++++++++++------------ config | 4 ++-- dwmbar | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/bar.sh b/bar.sh index 0614c09..187b3c3 100755 --- a/bar.sh +++ b/bar.sh @@ -32,7 +32,7 @@ get_bar() fi done # Uncomment to remove last separator - # bar=$(echo $bar | sed 's/.$//g') + bar=$(echo $bar | sed 's/.$//g') echo "$LEFT_PADDING$bar$RIGHT_PADDING" } @@ -51,17 +51,15 @@ run_module() run() { - # for module in $MODULES; do - # pgrep $module &> /dev/null - # notrunning=$([[ $? -eq 1 ]]) - # if $notrunning && [[ $INTERNET -eq 0 ]]; then - # run_module $module - # elif $notrunning && [[ $INTERNET -eq 1 ]]; then - # [[ "$ONLINE_MODULES" != *"$module"* ]] && run_module $module - # fi - # done - - parallel $MODULES_DIR{} ::: $MODULES + for module in $MODULES; do + pgrep $module &> /dev/null + notrunning=$([[ $? -eq 1 ]]) + if $notrunning && [[ $INTERNET -eq 0 ]]; then + run_module $module + elif $notrunning && [[ $INTERNET -eq 1 ]]; then + [[ "$ONLINE_MODULES" != *"$module"* ]] && run_module $module + fi + done get_bar sleep $DELAY; diff --git a/config b/config index c53aaeb..98bad4e 100644 --- a/config +++ b/config @@ -16,5 +16,5 @@ CUSTOM_DIR="/home/$USER/.config/dwmbar/modules/custom/" SEPARATOR=" | " # Padding at the end and beggining of the status bar -RIGHT_PADDING="$USER@$HOSTNAME " -LEFT_PADDING=" " +RIGHT_PADDING="" +LEFT_PADDING="" diff --git a/dwmbar b/dwmbar index dcb65e0..4617cf3 100755 --- a/dwmbar +++ b/dwmbar @@ -25,7 +25,7 @@ CUSTOM_DIR="$CONFIG_DIR/custom" CONFIG_FILE="$CONFIG_DIR/config" CACHE_DIR="$CONFIG_DIR/.cache" -INTERNET=0 +INTERNET=1 export INTERNET print_help(){