diff options
author | Horea Christian <chr@chymera.eu> | 2021-09-09 19:04:18 -0400 |
---|---|---|
committer | Horea Christian <chr@chymera.eu> | 2021-09-09 19:04:18 -0400 |
commit | 5971fadec832e6b970e7911e1919432c6052fdc7 (patch) | |
tree | 09a9d765d833f3eafe52d28363e94fbb47c40ea8 /bin/mailsync | |
parent | 2be8ea7871e6d07592d7b4ed85ace213774261f6 (diff) |
Check both new and cur dirs for notification
Also better formattin
Diffstat (limited to 'bin/mailsync')
-rwxr-xr-x | bin/mailsync | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/mailsync b/bin/mailsync index f00baf1..a633308 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -57,7 +57,14 @@ esac syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi - new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) + new=$(find\ + "$HOME/.local/share/mail/$acc/INBOX/new/"\ + "$HOME/.local/share/mail/$acc/Inbox/new/"\ + "$HOME/.local/share/mail/$acc/inbox/new/"\ + "$HOME/.local/share/mail/$acc/INBOX/cur/"\ + "$HOME/.local/share/mail/$acc/Inbox/cur/"\ + "$HOME/.local/share/mail/$acc/inbox/cur/"\ + -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) case 1 in $((newcount > 5)) ) notify "$acc" "$newcount" ;; |