mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-21 18:12:53 +00:00
Internet is off on startup. Cleaned up bar.sh and config
This commit is contained in:
parent
15dc3c709f
commit
71da49fab7
3 changed files with 13 additions and 15 deletions
22
bar.sh
22
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;
|
||||
|
|
4
config
4
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=""
|
||||
|
|
2
dwmbar
2
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(){
|
||||
|
|
Loading…
Reference in a new issue