summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x.local/bin/fetch_mail.sh14
-rwxr-xr-x.local/bin/status/sb-mailbox17
2 files changed, 22 insertions, 9 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
diff --git a/.local/bin/status/sb-mailbox b/.local/bin/status/sb-mailbox
index db0dd4e..3ce5f31 100755
--- a/.local/bin/status/sb-mailbox
+++ b/.local/bin/status/sb-mailbox
@@ -13,8 +13,9 @@ case $BLOCK_BUTTON in
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
-mb_a="$(ls "${MAIL:-/var/mail/jozan}"/bousset.rudy@gmail.com/INBOX/new/ | wc -l 2>/dev/null)"
-mb_b="$(ls "${MAIL:-/var/mail/jozan}"/olsen.oyvind.nor@gmail.com/INBOX/new/ | wc -l 2>/dev/null)"
+mb_a="$(ls "${MAIL:-/var/mail/jozan}"/main/INBOX/new/ | wc -l 2>/dev/null)"
+mb_b="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new/ | wc -l 2>/dev/null)"
+mb_c="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new/ | wc -l 2>/dev/null)"
sync=0
if pidof mbsync >/dev/null 2>&1; then
@@ -31,10 +32,20 @@ if [ "$mb_a" -gt 0 ]; then
echo -n "A:" $mb_a
fi
-if [ "$mb_a" -gt 0 ] && [ "$mb_a" -gt 0 ]; then
+if [ "$mb_a" -gt 0 ] && [ "$mb_b" -gt 0 ]; then
echo -n " "
fi
if [ "$mb_b" -gt 0 ]; then
echo -n "B:" $mb_b
fi
+
+if [ "$mb_b" -gt 0 ] && [ "$mb_c" -gt 0 ]; then
+ echo -n " "
+elif [ "$mb_a" -gt 0 ] && [ "$mb_c" -gt 0 ]; then
+ echo -n " "
+fi
+
+if [ "$mb_c" -gt 0 ]; then
+ echo -n "C:" $mb_c
+fi