Here is a neat Keyboard Maestro setup that automatically closes my email client whenever it’s been deactivated for 5 minutes. It consists of three macros working in tandem.

The first macro will close the mail app after 5 minutes. It starts out disabled and will disable itself whenever the email client gets active:

The second macro will enable the first macro whenever mail is deactivated. This starts the countdown of 5 minutes:

The last macro will disable the first macro whenever mail is activated or quit:

This process helps me to avoid having the email client open in the background. Less distraction, more focus.

Download the macros here.