Terminal Notifications #3

Open
opened 2025-10-27 22:04:15 +00:00 by jessebot · 0 comments
Owner

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.

Stuff I want notifications for:

Details about the MAIL features

From Interative Shell Behavior:

Bash will check for mail periodically, depending on the values of the MAIL, MAILPATH, and MAILCHECK shell variables (see 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

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. Stuff I want notifications for: - [ ] email notifications (from [issues/21#issue-1510450929](https://github.com/jessebot/dot_files/issues/21#issue-1510450929) in old repo) - [ ] branch is not clean compared to upstream <details> <summary>Details about the MAIL features</summary> 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) </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jessebot/dot_files#3
No description provided.