Skip to content

Instantly share code, notes, and snippets.

@guiniol
Created October 7, 2017 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guiniol/8dd87d93c554f425e6f3995e97e495db to your computer and use it in GitHub Desktop.
Save guiniol/8dd87d93c554f425e6f3995e97e495db to your computer and use it in GitHub Desktop.
fetch mail and apply tags
#!/bin/bash
mbsync -Va
notmuch new --try-decrypt
notmuch tag +neomutt-devel folder:neomutt and tag:tofilter and to:neomutt-devel
notmuch tag +neomutt-users folder:neomutt and tag:tofilter and to:neomutt-users
notmuch tag +github-issues folder:neomutt and tag:tofilter and from:github.com
notmuch tag +vim folder:neomutt and tag:tofilter and 'subject:[vim'
notmuch tag +vim folder:neomutt and tag:tofilter and to:vim-dev
notmuch tag +vim folder:neomutt and tag:tofilter and to:vim_dev
notmuch tag -tofilter tag:tofilter and from:gui-gui@netcourrier.com
COUNT=$(notmuch count tag:tofilter and tag:unread)
notmuch tag -tofilter tag:tofilter
if [ ${COUNT} != 0 ]; then
notify-send -h 'MAIL MOTHERFUCKER !!' "${COUNT} new messages"
mpv ~/.config/mutt/mail_motherfucker.m4a >/dev/null 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment