summaryrefslogtreecommitdiff
path: root/etc/.zprofile
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-08-27 20:11:51 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-08-27 21:10:10 +0200
commitbf1a9a038593d03c17999a4a67e4b25afe203c52 (patch)
tree9512727718d36d9d92c6f13f59daf0471ac92723 /etc/.zprofile
parentaa0f234f88caa11e1aaa3b965eb14664ffdf94ba (diff)
zprofile: Show maildirs which have new mail
Diffstat (limited to 'etc/.zprofile')
-rw-r--r--etc/.zprofile14
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} && \