aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-24 16:50:31 +0100
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-24 16:50:31 +0100
commitb4fb27fd60a64c608319c97826ec2f09f5c26732 (patch)
treefbc22a4ad1f4c484fe1824e5c74fce26e97f5723
parent4d1c3a91f7811732af65a7a0ac7d477f2a2a497b (diff)
Just use the source command, and added left padding.
-rw-r--r--TODO.org1
-rwxr-xr-xbar.sh15
-rw-r--r--config9
3 files changed, 10 insertions, 15 deletions
diff --git a/TODO.org b/TODO.org
index 9d5d61e..0646d1d 100644
--- a/TODO.org
+++ b/TODO.org
@@ -17,7 +17,6 @@ Each module writes to stdout.
- Have default modules in /usr/share/dwmbar and all the modules in the
.config/dwmbar/modules override the default ones (no need to have a custom
module dir)
-- Fix modules like temp cutting out when running
Bugs to fix:
None
diff --git a/bar.sh b/bar.sh
index c56cfa1..44c4ec0 100755
--- a/bar.sh
+++ b/bar.sh
@@ -15,23 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
CONFIG_FILE="/home/$USER/.config/dwmbar/config"
-DELAY=$(cat $CONFIG_FILE | grep -E "DELAY" | cut -d '"' -f2)
-MODULES_DIR="/home/$USER/.config/dwmbar/modules/"
-CUSTOM_DIR=$(cat $CONFIG_FILE | grep -E "CUSTOM_DIR" | cut -d '"' -f2)
-SEPARATOR=$(cat $CONFIG_FILE | grep -E "SEPARATOR" | cut -d '"' -f2)
-PADDING=$(cat $CONFIG_FILE | grep -E "PADDING" | cut -d '"' -f2)
+source $CONFIG_FILE
OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/"
OUTPUT=""
-# What modules, in what order
-MODULES=$(cat $CONFIG_FILE | grep -E "MODULES" | cut -d '"' -f2)
-
-# Modules that require an active internet connection
-ONLINE_MODULES=$(cat $CONFIG_FILE | grep -E "ONLINE_MODULES" | cut -d '"' -f2)
-
INTERNET=1 #0 being true
get_internet()
@@ -55,7 +46,7 @@ get_bar()
done
# Uncomment to remove last separator
# bar=$(echo $bar | sed 's/.$//g')
- echo "$bar$PADDING"
+ echo "$LEFT_PADDING$bar$RIGHT_PADDING"
}
run_module()
diff --git a/config b/config
index ce46b0e..503b487 100644
--- a/config
+++ b/config
@@ -1,5 +1,9 @@
+#!/bin/bash
+
+MODULES_DIR="/home/$USER/.config/dwmbar/modules/"
+
# What modules, in what order
-MODULES="mpd weather volumebar wifi internet cpuload temperature"
+MODULES="mpd weather volumebar wifi internet cpuload temperature date time"
# Modules that require an active internet connection
ONLINE_MODULES="weather internet"
@@ -14,4 +18,5 @@ CUSTOM_DIR="/home/$USER/.config/dwmbar/modules/custom/"
SEPARATOR=" | "
# Padding at the end and beggining of the status bar
-PADDING="$USER@$HOSTNAME "
+RIGHT_PADDING="$USER@$HOSTNAME "
+LEFT_PADDING=" "