summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/fetch_mail.sh14
-rwxr-xr-x.local/bin/status/sb-mailbox14
2 files changed, 15 insertions, 13 deletions
diff --git a/.local/bin/fetch_mail.sh b/.local/bin/fetch_mail.sh
index c30e309..0375f41 100755
--- a/.local/bin/fetch_mail.sh
+++ b/.local/bin/fetch_mail.sh
@@ -12,9 +12,10 @@ if [ -f $mc_file ]; then
pre_count=$(cat $mc_file)
else
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))"
+ mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)"
+ mb2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)"
+ mb3="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new | wc -l 2>/dev/null)"
+ pre_count="$((pre_count + mb1 + mb2 + mb3))"
fi
killall mbsync >/dev/null 2>&1
# notify-send -u low -t 3000 'mbsync' ' fetching mail...' >/dev/null 2>&1
@@ -26,9 +27,10 @@ gsleep 0.2
kill -74 $(pidof dwmblocks) >/dev/null 2>&1
fg
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))"
+mb1="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new | wc -l 2>/dev/null)"
+mb2="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new | wc -l 2>/dev/null)"
+mb3="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new | wc -l 2>/dev/null)"
+post_count="$((post_count + mb1 + mb2 + mb3))"
if [ $post_count -gt $pre_count ]; then
notify-send -u normal 'NeoMutt' ' '$post_count' new mail(s)'
fi
diff --git a/.local/bin/status/sb-mailbox b/.local/bin/status/sb-mailbox
index 892607c..0dfcbd6 100755
--- a/.local/bin/status/sb-mailbox
+++ b/.local/bin/status/sb-mailbox
@@ -24,7 +24,7 @@ if pidof mbsync >/dev/null 2>&1; then
fi
case "$sync" in
- 0) [ "$mb_a" -gt 0 ] || [ "$mb_b" -gt 0 ] && echo -n " " ;;
+ 0) ([ "$mb_a" -gt 0 ] || [ "$mb_b" -gt 0 ] || [ "$mb_c" -gt 0 ] || [ "$mb_d" -gt 0 ]) && echo -n " " ;;
1) echo -n " " ;;
*) ;;
esac
@@ -34,7 +34,7 @@ if [ "$mb_a" -gt 0 ]; then
fi
if [ "$mb_a" -gt 0 ] && [ "$mb_b" -gt 0 ]; then
- echo -n " "
+ echo -n " - "
fi
if [ "$mb_b" -gt 0 ]; then
@@ -42,9 +42,9 @@ if [ "$mb_b" -gt 0 ]; then
fi
if [ "$mb_b" -gt 0 ] && [ "$mb_c" -gt 0 ]; then
- echo -n " "
+ echo -n " - "
elif [ "$mb_a" -gt 0 ] && [ "$mb_c" -gt 0 ]; then
- echo -n " "
+ echo -n " - "
fi
if [ "$mb_c" -gt 0 ]; then
@@ -52,11 +52,11 @@ if [ "$mb_c" -gt 0 ]; then
fi
if [ "$mb_c" -gt 0 ] && [ "$mb_d" -gt 0 ]; then
- echo -n " "
+ echo -n " - "
elif [ "$mb_b" -gt 0 ] && [ "$mb_d" -gt 0 ]; then
- echo -n " "
+ echo -n " - "
elif [ "$mb_a" -gt 0 ] && [ "$mb_d" -gt 0 ]; then
- echo -n " "
+ echo -n " - "
fi
if [ "$mb_d" -gt 0 ]; then