From bf1a9a038593d03c17999a4a67e4b25afe203c52 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 27 Aug 2011 20:11:51 +0200 Subject: zprofile: Show maildirs which have new mail --- etc/.zprofile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/.zprofile b/etc/.zprofile index 2b8312d..d188205 100644 --- a/etc/.zprofile +++ b/etc/.zprofile @@ -18,7 +18,19 @@ pr_info "This is %F{cyan}$(uname -srm)%F{default} on %F{cyan}%y%F{default}" echo -[[ -n $(echo Maildir/new/*(N)) ]] && pr_info "You have mail!" +function { + typeset -a new_mail + + setopt local_options + setopt hist_subst_pattern + + new_mail=(~/Maildir/**/new(DF:h:s/*\\/Maildir\\/./)) + + if (( $#new_mail )); then + pr_info "Unread mail in: ${(j(, ))new_mail}" + fi +} + [[ -r ${ZDIR}/local-profile ]] && source ${ZDIR}/local-profile if [[ ${HOST} == (descent|saviour) && -z ${SSH_CONNECTION} && \ -- cgit v1.2.3