From: Matthew Owens <matthew@owens.tech>
Date: Thu, 30 Jul 2020 11:39:01 +0000 (+0100)
Subject: added mails, updated formatting
X-Git-Url: https://git.owens.tech/assets/editable-focus.html/assets/editable-focus.html/git?a=commitdiff_plain;h=f2da17a3b6cc96555e720914ec436f0530eb35c1;p=scripts.git

added mails, updated formatting
---

diff --git a/dwmbar b/dwmbar
index 6d71e75..250d37f 100755
--- a/dwmbar
+++ b/dwmbar
@@ -5,10 +5,15 @@ while true; do
 	date=$(date +"%F %T")
 	bat=$(bat)
 	updates=$(numupdates)
+	mails=$(mailcount)
 	if [[ $updates -ne 0 ]]; then
-		pkgs="pkgs: $updates |"
+		pkgs="pkgs: $updates | "
 	fi
 
-	xsetroot -name "$pkgs $bat | $date"
+	if [[ $mails -ne 0 ]]; then
+		mails="$mails new email(s) | "
+	fi
+
+	xsetroot -name "$mails$pkgs$bat | $date"
 	sleep 1s
 done