jessebot / dot_files

Default dot files for onboardme including bash, neovim, powerline, neomutt, w3m, wezterm, and more :)
https://jessebot.github.io/onboardme
GNU Affero General Public License v3.0
5 stars 3 forks source link

Terminal Notifications: Starting with email notifications #21

Open jessebot opened 1 year ago

jessebot commented 1 year ago

I spend so much time in the terminal, that I could use some email notifications there. It would be nice to have it be part of some background daemon that is already checking my mail, like powerline, or maybe even the built in MAIL features of BASH.

Details about the MAIL features From [Interative Shell Behavior](https://www.gnu.org/software/bash/manual/bash.html#Interactive-Shell-Behavior): > Bash will check for mail periodically, depending on the values of the MAIL, MAILPATH, and MAILCHECK shell variables (see [Bash Variables](https://www.gnu.org/software/bash/manual/bash.html#Bash-Variables)). These ENV vars are actually from the bourne shell: - `MAIL` If this parameter is set to a filename or directory name and the MAILPATH variable is not set, Bash informs the user of the arrival of mail in the specified file or Maildir-format directory. - `MAILPATH` A colon-separated list of filenames which the shell periodically checks for new mail. Each list entry can specify the message that is printed when new mail arrives in the mail file by separating the filename from the message with a ‘?’. When used in the text of the message, $_ expands to the name of the current mail file. - `MAILCHECK` How often (in seconds) that the shell should check for mail in the files specified in the MAILPATH or MAIL variables. The default is 60 seconds. When it is time to check for mail, the shell does so before displaying the primary prompt. If this variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking. Other interesting features: - shopt: `mailwarn` If set, and a file that Bash is checking for mail has been accessed since the last time it was checked, the message "The mail in mailfile has been read" is displayed. - `_` ($_, an underscore.) At shell startup, set to the pathname used to invoke the shell or shell script being executed as passed in the environment or argument list. Subsequently, expands to the last argument to the previous simple command executed in the foreground, after expansion. Also set to the full pathname used to invoke each command executed and placed in the environment exported to that command. When checking mail, this parameter holds the name of the mail file. - Source: [gnu.org/software/bash/manual/bash.html#Bash-Builtins](https://www.gnu.org/software/bash/manual/bash.html)