mirror of
https://github.com/Misterio77/Foundry.git
synced 2026-08-24 10:04:09 -05:00
fix(home/waybar): count unread mail by Maildir flags
Assisted-by: pi (gpt-5.6-sol)
This commit is contained in:
@@ -174,10 +174,11 @@ in {
|
|||||||
exec = mkScriptJson {
|
exec = mkScriptJson {
|
||||||
deps = [pkgs.findutils pkgs.gawk];
|
deps = [pkgs.findutils pkgs.gawk];
|
||||||
script = ''
|
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
|
if [ -z "$inbox_count" ]; then
|
||||||
status="read"
|
status="read"
|
||||||
inbox_count="No new mail!"
|
inbox_count="No unread mail!"
|
||||||
else
|
else
|
||||||
status="unread"
|
status="unread"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user