dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

listen-new-mail (388B)


      1 #!/bin/sh
      2 
      3 # Listen for changes forever
      4 while true; do
      5 	ls -d                                       \
      6 		"$HOME"/mail/webmail-*/INBOX/new/       \
      7 		"$HOME"/mail/webmail-*/INBOX/new/*      \
      8 		2>/dev/null | entr -n -r -a -d -p 2>/dev/null echo
      9 	count="$(find "$HOME"/mail/webmail-*/INBOX/new/* 2>/dev/null | wc -l)"
     10 	[ "$count" != "0" ] && ztatus-notify "you have $count new mail(s)"
     11 done