diff options
author | Moritz Poldrack <git@moritz.sh> | 2023-03-15 22:40:37 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-04-01 01:01:09 +0200 |
commit | 2fef0f4a60c8026c156ad8d75078bccde6a540d8 (patch) | |
tree | cff6819cd0950294ee5e7c20b57582c23d628b4e /doc/aerc-config.5.scd | |
parent | 088d63ce934c34e113a5b3154dfcf91b49132067 (diff) | |
download | aerc-2fef0f4a60c8026c156ad8d75078bccde6a540d8.tar.gz |
config: replace triggers with hooks
Deprecate triggers and replace them with hooks. Now that aerc supports
running arbitrary ex commands over IPC, it is possible to run internal
aerc commands *and* shell commands via external shell scripts. Hooks
only allow running shell commands. Hooks info is passed via environment
variables.
Implements: https://todo.sr.ht/~rjarry/aerc/136
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to 'doc/aerc-config.5.scd')
-rw-r--r-- | doc/aerc-config.5.scd | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index 54c7df7f..9e11abfe 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -819,23 +819,26 @@ text/plain=gvim {} +125 message/rfc822=thunderbird ``` -# TRIGGERS +## HOOKS -Triggers specify commands to execute when certain events occur. They are -configured in the *[triggers]* section of _aerc.conf_. +Hooks are triggered whenever the associated event occurs. The commands are run +in a shell environment with information added to environment variables. -The commands are not shell commands (i.e. they are not executed with _sh -c_) -and will be split in multiple arguments following basic shell quoting. They need -to use one of the commands described in *aerc*(1) without the leading colon *:* -(e.g. _exec foo bar_ instead of _:exec foo bar_). +They are configured in the *[hooks]* section of aerc.conf. -*new-email* = _<command>_ - Executed when a new email arrives in the selected folder. Example: +*mail-received* = _<command>_ + Executed when new mail is received in the selected folder. This will + only work reliably with maildir and some imap servers. - exec notify-send 'New email from {{.From | names | join ", "}}' '{{.Subject}}' + Variables: - Templates specifiers from *aerc-templates*(7) are expanded with respect - to the new message. + - *AERC_FROM_NAME* + - *AERC_FROM_ADDRESS* + - *AERC_SUBJECT* + + Example: + + *mail-received* = _notify-send "New mail from $AERC_FROM_NAME" "$AERC_SUBJECT"_ # TEMPLATES |