added mails, updated formatting
authorMatthew Owens <matthew@owens.tech>
Thu, 30 Jul 2020 11:39:01 +0000 (12:39 +0100)
committerMatthew Owens <matthew@owens.tech>
Thu, 30 Jul 2020 11:39:01 +0000 (12:39 +0100)
dwmbar

diff --git a/dwmbar b/dwmbar
index 6d71e75..250d37f 100755 (executable)
--- 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