aboutsummaryrefslogtreecommitdiff
path: root/config/waybar/email.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/waybar/email.sh')
-rwxr-xr-xconfig/waybar/email.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/config/waybar/email.sh b/config/waybar/email.sh
new file mode 100755
index 0000000..437566f
--- /dev/null
+++ b/config/waybar/email.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+filter=("tag:unread" "and" "not" "tag:killed")
+
+if allsync enabled 2>/dev/null; then
+ sync="󰑤"
+else
+ sync=""
+fi
+
+part=()
+for mail in email gmail elektroline fel; do
+ counts="$(notmuch count -- "${filter[@]}" and "tag:$mail")"
+ [ "$counts" = "0" ] || \
+ part+=("$mail:$counts")
+done
+
+echo "$sync" "${part[@]}"
+echo
+echo "#email"