Global Hooks

Define actions to run globally within Mutt

1. Introduction

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

Run a command...

  • timeout-hook - periodically

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

  • shutdown-hook - mutt 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 Mutt checks for new mail. This hook is called every $timeoutseconds.

1.2. Startup Hook

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

Since: NeoMutt 2016-11-25

This feature implements a new hook that is called when Mutt 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 mutt shuts down, before closing the last mailbox

Since: NeoMutt 2016-11-25

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

2. Commands

timeout-hook MUTT-COMMAND

startup-hook MUTT-COMMAND

shutdown-hook MUTT-COMMAND

3. Muttrc

# Example NeoMutt config file for the global hooks feature.

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


# vim: syntax=muttrc

4. See Also

5. Known Bugs

None

6. Credits