fix(home/waybar): count unread mail by Maildir flags

Assisted-by: pi (gpt-5.6-sol)
This commit is contained in:
Gabriel Fontes
2026-08-15 08:56:57 -03:00
parent 317a703a09
commit 17e9e5f983
@@ -174,10 +174,11 @@ in {
exec = mkScriptJson {
deps = [pkgs.findutils pkgs.gawk];
script = ''
inbox_count="$(find ~/Mail/*/Inbox/new -type f | cut -d / -f5 | uniq -c | awk '{$1=$1};1')"
inbox_count="$(find ~/Mail/*/Inbox/{new,cur} -type f ! -name '*:2,*S*' \
| awk -F / '{count[$5]++} END {for (account in count) print count[account], account}')"
if [ -z "$inbox_count" ]; then
status="read"
inbox_count="No new mail!"
inbox_count="No unread mail!"
else
status="unread"
fi