summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2016-01-22 16:52:03 +0000
committerUrbain Vaes <urbain@vaes.uk>2016-01-22 16:52:03 +0000
commite9c25ee0bbbf2f97c223d037b83b89915db63999 (patch)
tree0efe84fc2968d0ebc22f7c6d5098bb04e8c8a1aa
parentfe054f7d5f4ffe6f6bf3121e821b7783c93d9ee2 (diff)
Add script to fetch email
-rw-r--r--.crontab1
-rw-r--r--.mutt/muttrc3
-rw-r--r--.vifm/scripts/README6
-rw-r--r--.vim/vimrc11
-rwxr-xr-xbin/email14
5 files changed, 18 insertions, 17 deletions
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 "<change-folder> +Personal/Personal<enter>"
macro index,pager gi "<change-folder> +Informal/Informal<enter>"
macro index,pager gw "<change-folder> +Work/Work<enter>"
-macro index d "WNk<delete-message>"
-
# Key bindings
bind attach <return> 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 <Leader>sc :source %<cr>
" File edits
nnoremap <Leader>es :UltiSnipsEdit<cr>
-nnoremap <Leader>em :e ~/dotfiles/mutt/muttrc<cr>
-nnoremap <Leader>en :e ~/dotfiles/nvimrc<cr>
-nnoremap <Leader>ev :e ~/dotfiles/vimrc<cr>
-nnoremap <Leader>ez :e ~/dotfiles/zshrc<cr>
-nnoremap <Leader>et :e ~/dotfiles/tmux.conf<cr>
+nnoremap <Leader>em :e ~/dotfiles/.mutt/muttrc<cr>
+nnoremap <Leader>ev :e ~/dotfiles/.vim/vimrc<cr>
+nnoremap <Leader>ez :e ~/dotfiles/.zsh/zshrc<cr>
+nnoremap <Leader>et :e ~/dotfiles/.tmux.conf<cr>
" Formatting
nnoremap <Leader>fw :%s/\s\+$//<cr>
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)".