aboutsummaryrefslogtreecommitdiff
path: root/config/waybar/email.sh
blob: 437566f66c5c59f27714cfe5bffecd641f4184b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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"