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 --- .crontab | 1 + .mutt/muttrc | 3 +-- .vifm/scripts/README | 6 ++++++ .vim/vimrc | 11 +++++------ bin/email | 14 +++++--------- 5 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 .crontab create mode 100644 .vifm/scripts/README diff --git a/.crontab b/.crontab new file mode 100644 index 0000000..cc69c4c --- /dev/null +++ b/.crontab @@ -0,0 +1 @@ +*/5 * * * * /home/urbain/bin/email >> /home/urbain/.cron_email_log diff --git a/.mutt/muttrc b/.mutt/muttrc index 102b92d..5fdc682 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -20,6 +20,7 @@ set sort = reverse-date set weed set fcc_clear unset markers +set sleep_time = 0 # Encryption set crypt_autosign = no @@ -60,8 +61,6 @@ macro index,pager gp " +Personal/Personal" macro index,pager gi " +Informal/Informal" macro index,pager gw " +Work/Work" -macro index d "WNk" - # Key bindings bind attach view-mailcap diff --git a/.vifm/scripts/README b/.vifm/scripts/README new file mode 100644 index 0000000..8165c2f --- /dev/null +++ b/.vifm/scripts/README @@ -0,0 +1,6 @@ +This directory is dedicated for user-supplied scripts/executables. +vifm modifies its PATH environment variable to let user run those +scripts without specifying full path. All subdirectories are added +as well. File in a subdirectory overrules file with the same name +in parent directories. Restart might be needed to recognize files +in newly created or renamed subdirectories. diff --git a/.vim/vimrc b/.vim/vimrc index 389b0f1..059e600 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -174,7 +174,7 @@ set lazyredraw set hidden " mutt -au BufRead *mutt* set tw=72 +au BufRead /tmp/mutt-* set tw=72 " Colorscheme if $COLORSCHEME=="light" @@ -224,11 +224,10 @@ nnoremap sc :source % " File edits nnoremap es :UltiSnipsEdit -nnoremap em :e ~/dotfiles/mutt/muttrc -nnoremap en :e ~/dotfiles/nvimrc -nnoremap ev :e ~/dotfiles/vimrc -nnoremap ez :e ~/dotfiles/zshrc -nnoremap et :e ~/dotfiles/tmux.conf +nnoremap em :e ~/dotfiles/.mutt/muttrc +nnoremap ev :e ~/dotfiles/.vim/vimrc +nnoremap ez :e ~/dotfiles/.zsh/zshrc +nnoremap et :e ~/dotfiles/.tmux.conf " Formatting nnoremap fw :%s/\s\+$// 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