Internet is off on startup. Cleaned up bar.sh and config

This commit is contained in:
Archie Hilton (thytom) 2019-11-04 09:21:40 +00:00
parent 15dc3c709f
commit 71da49fab7
3 changed files with 13 additions and 15 deletions

22
bar.sh
View file

@ -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;

4
config
View file

@ -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=""

2
dwmbar
View file

@ -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(){