Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2020-10-14 00:35:04 +02:00
parent 7f449df84d
commit 0456d713b6
12 changed files with 37 additions and 19 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh -l
#!/bin/bash
# Sync mail and give notification if there is new mail.
# Run only if user logged in (prevent cron errors)
@ -31,7 +31,7 @@ fi
syncandnotify() {
acc="$(echo "$account" | sed "s/.*\///")"
mbsync $opts "$acc"
new=$(find $(ls $HOME/.local/share/mail/$acc/* | grep -i inbox | sed 's/\://')/new -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null)
new=$(find $(ls $HOME/.local/share/mail/$acc/* | grep -i inbox | sed 's/\://')/new -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null)
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
if [ "$newcount" -gt "0" ]; then
notify "$acc" "$newcount" &