From e9c25ee0bbbf2f97c223d037b83b89915db63999 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Fri, 22 Jan 2016 16:52:03 +0000 Subject: Add script to fetch email --- bin/email | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'bin') diff --git a/bin/email b/bin/email index 1d51ef8..4261366 100755 --- a/bin/email +++ b/bin/email @@ -1,10 +1,6 @@ #! /usr/bin/env bash - -while true; -do - mbsync -a - nmails=$(find $HOME/.mail -path '*/new/*' -type f | wc -l) - [[ nmails -ge 1 ]] && notify-send -t 1 "New mail!" - date - sleep 5m -done +export DISPLAY=:0 +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!" +echo "Email last checked on $(date)". -- cgit v1.2.3