From d5c97e78d80177119421f9dade324b04f2b00126 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Thu, 9 Apr 2020 01:30:04 +0300 Subject: mail scripts for aerc+mbsync; goodbye neomutt --- dotfiles/.local/bin/barmailstatus | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 dotfiles/.local/bin/barmailstatus (limited to 'dotfiles/.local/bin/barmailstatus') diff --git a/dotfiles/.local/bin/barmailstatus b/dotfiles/.local/bin/barmailstatus new file mode 100755 index 0000000..d40a73d --- /dev/null +++ b/dotfiles/.local/bin/barmailstatus @@ -0,0 +1,14 @@ +#!/bin/sh + +total=0 + +# Check all accounts/mailboxes for new mail. +for mailbox in "$HOME/.local/share/mail/"* +do + account="$(echo "$mailbox" | sed "s/.*\///")" + newcount=$(find "$HOME/.local/share/mail/$account/INBOX/new/" "$HOME/.local/share/mail/$account/Inbox/new/" "$HOME/.local/share/mail/$account/inbox/new/" -type f 2> /dev/null | wc -l) + total=$((total + newcount)) +done + +[ $total -gt 0 ] && echo "$total" + -- cgit v1.2.3