aboutsummaryrefslogtreecommitdiff
path: root/dwmbar
diff options
context:
space:
mode:
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