diff options
author | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-01 18:21:57 +0000 |
---|---|---|
committer | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-01 18:21:57 +0000 |
commit | 1ee52f23d35389d892af8b9836a237acbf93d7b8 (patch) | |
tree | 139ab3f9c18ee9f0cbe425d03894b2cfd39601fb /bar.sh | |
parent | c71729d8919b9637e02159ffec7e6d8f1360d65f (diff) | |
parent | 83de952093c62ead12a2a8d824718befb8cba3aa (diff) |
Merge branch 'curlisbloat'
Diffstat (limited to 'bar.sh')
-rwxr-xr-x | bar.sh | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -23,19 +23,6 @@ OUTPUT="" CONFIG_FILE="/home/$USER/.config/dwmbar/config" source $CONFIG_FILE -INTERNET=1 #0 being true - -get_internet() -{ - curl -q http://google.com &> /dev/null - - if [[ $? -eq 0 ]]; then - INTERNET=0 - else - INTERNET=1 - fi -} - get_bar() { for module in $MODULES; do @@ -64,12 +51,12 @@ run_module() run() { - get_internet for module in $MODULES; do pgrep $module &> /dev/null - if [[ $? -eq 1 ]] && [[ $INTERNET -eq 0 ]]; then - run_module $module & - else + 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 |