From f2da17a3b6cc96555e720914ec436f0530eb35c1 Mon Sep 17 00:00:00 2001
From: Matthew Owens <matthew@owens.tech>
Date: Thu, 30 Jul 2020 12:39:01 +0100
Subject: [PATCH] added mails, updated formatting

---
 dwmbar | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

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
-- 
2.20.1