diff options
author | Joe <bousset.rudy@gmail.com> | 2022-09-05 09:40:42 +0200 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2022-09-05 09:40:42 +0200 |
commit | a8669212d737a6afeda450c93e74f090f00f8760 (patch) | |
tree | 357d90871095054a2b68d572be1246113de6cabf /.local | |
parent | up (diff) | |
download | dotfiles-bsd-a8669212d737a6afeda450c93e74f090f00f8760.tar.gz dotfiles-bsd-a8669212d737a6afeda450c93e74f090f00f8760.tar.bz2 dotfiles-bsd-a8669212d737a6afeda450c93e74f090f00f8760.tar.xz dotfiles-bsd-a8669212d737a6afeda450c93e74f090f00f8760.tar.zst dotfiles-bsd-a8669212d737a6afeda450c93e74f090f00f8760.zip |
up
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/status/sb-mailbox | 22 |
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 " " |