fix: exit if no new mail, even when syncing
This commit is contained in:
parent
bdef14fd32
commit
5243ab4b38
@ -14,16 +14,12 @@ unread=""
|
|||||||
for acc in $(ls "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/)
|
for acc in $(ls "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/)
|
||||||
do
|
do
|
||||||
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
|
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
|
||||||
if [ -n "$new" ]; then
|
if [ $new -gt 0 ]; then
|
||||||
[ -n "$(echo "$acc" | sed -n '/@etu/p')" ] && box=""
|
[ -n "$(echo "$acc" | sed -n '/@etu/p')" ] && box=""
|
||||||
[ -n "$(echo "$acc" | sed -n '/@posteo/p')" ] && box=""
|
[ -n "$(echo "$acc" | sed -n '/@posteo/p')" ] && box=""
|
||||||
unread="$unread/$box:$new"
|
unread="$unread/$box:$new"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[ -n "$unread" ] && unread="($(echo "$unread" | cut -c 2-))" || unread="---"
|
[ -n "$unread" ] && unread="($(echo "$unread" | cut -c 2-))" || exit
|
||||||
|
|
||||||
pidof mbsync >/dev/null 2>&1 && icon=""
|
|
||||||
|
|
||||||
[ "$unread" = "0" ] && [ "$icon" = "" ] || echo " $unread$icon"
|
|
||||||
|
|
||||||
|
|
||||||
|
printf " %s%s" "$unread" "$icon"
|
||||||
|
Reference in New Issue
Block a user