summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/status/sb-mailbox22
1 files changed, 15 insertions, 7 deletions
diff --git a/.local/bin/status/sb-mailbox b/.local/bin/status/sb-mailbox
index 22db3f4..4fdd655 100755
--- a/.local/bin/status/sb-mailbox
+++ b/.local/bin/status/sb-mailbox
@@ -13,16 +13,24 @@ case $BLOCK_BUTTON in
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
-icon=""
+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)"
+
+sync=0
+if pidof mbsync >/dev/null 2>&1; then
+ sync=1
+fi
+
+case "$sync" in
+ 0) [ "$mb_a" -gt 0 ] || [ "$mb_b" -gt 0 ] && echo -n " " ;;
+ 1) echo -n " " ;;
+ *) ;;
+esac
-mb_a="$(ls "${MAIL:-/var/mail/jozan}"/bousset.rudy@gmail.com/INBOX/new/ | wc -l 2>/dev/null)"
if [ "$mb_a" -gt 0 ]; then
- echo -n " $icon A:" $mb_a
+ echo -n "A:" $mb_a
fi
-mb_b="$(ls "${MAIL:-/var/mail/jozan}"/olsen.oyvind.nor@gmail.com/INBOX/new/ | wc -l 2>/dev/null)"
if [ "$mb_b" -gt 0 ]; then
- echo -n " $icon B:" $mb_b
+ echo -n "B:" $mb_b
fi
-
-pidof mbsync >/dev/null 2>&1 && echo " "