diff options
Diffstat (limited to '.local/bin/fetch_mail.sh')
-rwxr-xr-x | .local/bin/fetch_mail.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/.local/bin/fetch_mail.sh b/.local/bin/fetch_mail.sh index 1f2889b..c30e309 100755 --- a/.local/bin/fetch_mail.sh +++ b/.local/bin/fetch_mail.sh @@ -11,9 +11,10 @@ mc_file="/tmp/newmailcount" if [ -f $mc_file ]; then pre_count=$(cat $mc_file) else - pre_count="$(ls "${MAIL:-/var/mail/jozan}"/bousset.rudy@gmail.com/INBOX/new | wc -l 2>/dev/null)" - tmp="$(ls "${MAIL:-/var/mail/jozan}"/olsen.oyvind.nor@gmail.com/INBOX/new | wc -l 2>/dev/null)" - pre_count="$((pre_count + tmp))" + pre_count="$(ls "${MAIL:-/var/mail/jozan}"/main/INBOX/new | wc -l 2>/dev/null)" + tmp1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)" + tmp2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)" + pre_count="$((pre_count + tmp1 + tmp2))" fi killall mbsync >/dev/null 2>&1 # notify-send -u low -t 3000 'mbsync' ' fetching mail...' >/dev/null 2>&1 @@ -24,9 +25,10 @@ killall mbsync >/dev/null 2>&1 gsleep 0.2 kill -74 $(pidof dwmblocks) >/dev/null 2>&1 fg -post_count="$(ls "${MAIL:-/var/mail/jozan}"/bousset.rudy@gmail.com/INBOX/new | wc -l 2>/dev/null)" -tmp="$(ls "${MAIL:-/var/mail/jozan}"/olsen.oyvind.nor@gmail.com/INBOX/new | wc -l 2>/dev/null)" -post_count="$((post_count + tmp))" +post_count="$(ls "${MAIL:-/var/mail/jozan}"/main/INBOX/new | wc -l 2>/dev/null)" +tmp1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)" +tmp2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)" +post_count="$((post_count + tmp1 + tmp2))" if [ $post_count -gt $pre_count ]; then notify-send -u normal 'NeoMutt' ' '$post_count' new mail(s)' fi |