aboutsummaryrefslogtreecommitdiff
path: root/dwmbar
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-01 18:21:46 +0000
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-01 18:21:46 +0000
commit83de952093c62ead12a2a8d824718befb8cba3aa (patch)
treed42a792b8ecdfe4e140ce8fa5cc4d45f34bbb23d /dwmbar
parent10570d7692ed6ef83d1513587f8618002da6386f (diff)
Fixed CPU issue and made internet work
Bash backgrounding is bloat
Diffstat (limited to 'dwmbar')
-rwxr-xr-xdwmbar19
1 files changed, 16 insertions, 3 deletions
diff --git a/dwmbar b/dwmbar
index 62c26ee..166c4ad 100755
--- a/dwmbar
+++ b/dwmbar
@@ -1,12 +1,10 @@
#!/bin/bash
-
# Copyright 2019 Archie Hilton <archie.hilton1@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -27,6 +25,9 @@ CUSTOM_DIR="$CONFIG_DIR/custom"
CONFIG_FILE="$CONFIG_DIR/config"
CACHE_DIR="$CONFIG_DIR/.cache"
+INTERNET=0
+export INTERNET
+
print_help(){
echo "dwmbar $VERSION
-v Display this help message.
@@ -75,5 +76,17 @@ done
check_files
while :; do
- xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)"
+ date=$(date +'%S')
+ if [ $(( 10#$date % 5 )) -eq 0 ]; then
+ echo "check"
+ wget --spider -q www.google.com
+
+ if [[ $? -eq 0 ]]; then
+ INTERNET=0
+ else
+ INTERNET=1
+ fi
+ fi
+ xsetroot -name "$INTERNET $(exec $DEFAULT_BAR_LOCATION)"
+ # xsetroot -name "$INTERNET"
done