Skip to content

Commit

Permalink
Fix double formatting in mailcount for mbox.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikw committed Mar 19, 2013
1 parent 23d31dc commit 91ff34b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion segments/date.sh
Expand Up @@ -4,7 +4,7 @@ TMUX_POWERLINE_SEG_DATE_FORMAT_DEFAULT="%F"

generate_segmentrc() {
read -d '' rccontents << EORC
# date(1) format for the date. If you don't, for some reason like ISO 8601 format, you might want to have "%D" or "%m/%d/%Y".
# date(1) format for the date. If you don't, for some reason, like ISO 8601 format you might want to have "%D" or "%m/%d/%Y".
export TMUX_POWERLINE_SEG_DATE_FORMAT="${TMUX_POWERLINE_SEG_DATE_FORMAT_DEFAULT}"
EORC
echo "$rccontents"
Expand Down
8 changes: 2 additions & 6 deletions segments/mailcount.sh
Expand Up @@ -78,7 +78,6 @@ run_segment() {
return $exitcode
fi


if [[ -n "$count" && "$count" -gt 0 ]]; then
echo "${count}"
fi
Expand Down Expand Up @@ -164,12 +163,9 @@ __count_mbox() {
# This matches the From_ line (see man 5 mbox) e.g.
# From noreply@github.com Sun Dec 2 03:52:25 2012
# See https://github.com/erikw/tmux-powerline/pull/91#issuecomment-10926053 for discussion.
nbr_new=$(grep -c '^From [^[:space:]]\+ ... ... .. ..:..:.. ....$' ${TMUX_POWERLINE_SEG_MAILCOUNT_MBOX_INBOX})

if [ "${nbr_new}" -gt "0" ]; then
echo "${nbr_new}"
fi
count=$(grep -c '^From [^[:space:]]\+ ... ... .. ..:..:.. ....$' ${TMUX_POWERLINE_SEG_MAILCOUNT_MBOX_INBOX})

echo "$count"
return 0;
}

Expand Down

0 comments on commit 91ff34b

Please sign in to comment.