aboutsummaryrefslogtreecommitdiff
path: root/dwmbar
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-07 21:51:37 +0000
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-07 21:51:37 +0000
commit858e26828f514b272cc3bf62abe8a9ee8b520c63 (patch)
tree27cde8e438d8b759987db7b52e64176c216c58f5 /dwmbar
parentbff03413acbe5b7c9c546f69caaa1be8fa6b6d8e (diff)
Fixed wget hanging dwmbar
Diffstat (limited to 'dwmbar')
-rwxr-xr-xdwmbar14
1 files changed, 9 insertions, 5 deletions
diff --git a/dwmbar b/dwmbar
index a76d807..280e254 100755
--- a/dwmbar
+++ b/dwmbar
@@ -89,12 +89,9 @@ while getopts 'vc' flag; do
esac
done
-check_files
-
-while :; do
- date=$(date +'%S')
+check_internet() {
if [ $(( 10#$date % 5 )) -eq 0 ]; then
- wget --spider -q www.google.com
+ wget --spider -q www.google.com --timeout=3
if [[ $? -eq 0 ]]; then
INTERNET=0
@@ -102,5 +99,12 @@ while :; do
INTERNET=1
fi
fi
+}
+
+check_files
+
+while :; do
+ date=$(date +'%S')
+ check_internet &
xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)"
done