diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-08-27 20:11:51 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-08-27 21:10:10 +0200 |
commit | bf1a9a038593d03c17999a4a67e4b25afe203c52 (patch) | |
tree | 9512727718d36d9d92c6f13f59daf0471ac92723 /etc | |
parent | aa0f234f88caa11e1aaa3b965eb14664ffdf94ba (diff) |
zprofile: Show maildirs which have new mail
Diffstat (limited to 'etc')
-rw-r--r-- | etc/.zprofile | 14 |
1 files changed, 13 insertions, 1 deletions
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} && \ |