Global Hooks

Define actions to run globally within NeoMutt

1. Introduction

These hooks are called when global events take place in NeoMutt.

Run a command...

  • timeout-hook - periodically

  • startup-hook - when NeoMutt starts up, before opening the first mailbox

  • shutdown-hook - NeoMutt shuts down, before closing the last mailbox

1.1. Timeout Hook

Run a command periodically

Since: NeoMutt 2016-08-08

This feature implements a new hook that is called periodically when NeoMutt checks for new mail. This hook is called every $timeout seconds.

1.2. Startup Hook

Run a command when NeoMutt starts up, before opening the first mailbox

Since: NeoMutt 2016-11-25

This feature implements a new hook that is called when NeoMutt first starts up, but before opening the first mailbox. This is most likely to be useful to users of notmuch.

1.3. Shutdown Hook

Run a command when NeoMutt shuts down, before closing the last mailbox

Since: NeoMutt 2016-11-25

This feature implements a hook that is called when NeoMutt shuts down, but before closing the first mailbox. This is most likely to be useful to users of notmuch.

2. Commands

timeout-hook NEOMUTT-COMMAND

startup-hook NEOMUTT-COMMAND

shutdown-hook NEOMUTT-COMMAND

3. neomuttrc

# Example NeoMutt config file for the global hooks feature.

# --------------------------------------------------------------------------
# COMMANDS - shown with an example argument
# --------------------------------------------------------------------------
# After $timeout seconds of inactivity, run this NeoMutt command
timeout-hook 'exec sync-mailbox'
# When NeoMutt first loads, run this NeoMutt command
startup-hook 'exec sync-mailbox'
# When NeoMutt quits, run this NeoMutt command
shutdown-hook 'exec sync-mailbox'


# vim: syntax=neomuttrc

4. See Also

5. Known Bugs

None

6. Credits