Add support for custom message formats

This commit is contained in:
Michael Aquilina 2019-07-30 19:35:24 +01:00
parent eaf5936f1e
commit aed7176e73
No known key found for this signature in database
GPG key ID: 636066730B056BD1
4 changed files with 77 additions and 5 deletions

View file

@ -93,6 +93,21 @@ can configure this value by setting the environment variable ``AUTO_NOTIFY_THRES
# Set threshold to 20seconds
export AUTO_NOTIFY_THRESHOLD=20
**Notification Formatting**
You can change the formatting of notifications by setting the values for ``AUTO_NOTIFY_TITLE`` and
``AUTO_NOTIFY_BODY``. When writing these values, the following variables will be replaced according to
the data that ``auto-notify`` has detected:
* `%command` - the command that the user executed
* `%elapsed` - number of seconds that elapsed
* `%exit_code` - the exit code of the command that was executed
An example of how these values can be set is shown below:
::
export AUTO_NOTIFY_TITLE="Hey! %command has just finished"
export AUTO_NOTIFY_BODY="It completed in %elapsed seconds with exit code %exit_code"
**Notification Expiration Time**