summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2016-01-23 17:35:07 +0000
committerUrbain Vaes <urbain@vaes.uk>2016-01-23 17:35:07 +0000
commitb28f58b7804b77af32343732a8651ff8c487ea04 (patch)
tree76461564d8a05556f729f55b466237dd6da8aca4
parente9c25ee0bbbf2f97c223d037b83b89915db63999 (diff)
Update mr
-rw-r--r--.mr/mrconfig2
-rwxr-xr-xbin/email14
2 files changed, 13 insertions, 3 deletions
diff --git a/.mr/mrconfig b/.mr/mrconfig
index 95f874e..3914bfb 100644
--- a/.mr/mrconfig
+++ b/.mr/mrconfig
@@ -2,7 +2,7 @@
checkout = git clone 'git@github.com:uvaes/dotfiles' 'dotfiles'
[.personal]
-checkout = git clone 'git@github.com:uvaes/personal' '.personal'
+checkout = git clone 'urbain@urbainvaes.com:git/perso/personal.git' '.personal'
[.vim/vim-plug]
checkout = git clone 'https://github.com/junegunn/vim-plug' 'vim-plug'
diff --git a/bin/email b/bin/email
index 4261366..84e923e 100755
--- a/bin/email
+++ b/bin/email
@@ -1,6 +1,16 @@
#! /usr/bin/env bash
+
+# Necessary to see the notification
export DISPLAY=:0
+
+# Get all emails
mbsync -a
-nmails=$(find $HOME/.mail -path '*/new/*' -type f | wc -l)
-[[ nmails -ge 1 ]] && /usr/bin/notify-send -t 1 "New mail!" || /usr/bin/notify-send -u low -t 1 "No new mail!"
+
+new_mails=$(find $HOME/.mail -path '*/new/*' -type f)
+subjects=$(cat $(echo -e ${new_mails/'\n'/' '}) | grep "^Subject: " | sed "s/^Subject: //g")
+
+if [[ ! -z ${new_mails} ]]; then
+ /usr/bin/notify-send -t 3 "New mail(s)!" "${subjects}"
+fi
+
echo "Email last checked on $(date)".