aboutsummaryrefslogtreecommitdiff
path: root/config/i3blocks/scripts/email
blob: d2213e0238b273e0098ef3b4b82807959fed5c61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
filter=("tag:unread" "and" "not" "tag:killed")

part=()
all=0
for mail in email gmail nic fel; do
	counts="$(notmuch count -- "${filter[@]}" and "tag:$mail")"
	[ "$counts" = "0" ] || \
		part+=("$mail:$counts")
	((all = all + counts))
done

echo "${part[@]}"
if [ "$all" = "0" ]; then
	echo
else
	echo "mails:$all"
fi
echo "#ffff00"