aboutsummaryrefslogtreecommitdiff
path: root/dwmbar
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-07 22:07:34 +0000
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-07 22:07:34 +0000
commit472ee9b149e377efb52c2fea0b3aa725553f476b (patch)
treeec01627e539f403b1b96a26202a6bdebf687ed72 /dwmbar
parent858e26828f514b272cc3bf62abe8a9ee8b520c63 (diff)
And some more fixes
Diffstat (limited to 'dwmbar')
-rwxr-xr-xdwmbar15
1 files changed, 7 insertions, 8 deletions
diff --git a/dwmbar b/dwmbar
index 280e254..ba0de22 100755
--- a/dwmbar
+++ b/dwmbar
@@ -39,7 +39,7 @@ export CONFIG_FILE
CACHE_DIR="$HOME/.cache/dwmbar/"
export CACHE_DIR
-INTERNET=1
+INTERNET=1 # No internet
export INTERNET
print_help(){
@@ -90,21 +90,20 @@ while getopts 'vc' flag; do
done
check_internet() {
- if [ $(( 10#$date % 5 )) -eq 0 ]; then
- wget --spider -q www.google.com --timeout=3
-
+ wget --spider -q --timeout=2 www.google.com
if [[ $? -eq 0 ]]; then
- INTERNET=0
+ echo 0
else
- INTERNET=1
+ echo 1
fi
- fi
}
check_files
while :; do
date=$(date +'%S')
- check_internet &
+ if [ $(( 10#$date % 5 )) -eq 0 ]; then
+ INTERNET=$(check_internet)
+ fi
xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)"
done