2

I often use caffeinate to ensure that tasks on my OS X systems run to completion without interruption, and would like to be able to disable caffeinate to allow normal sleep once my tasks have completed.

Is there a way to turn off all running caffeinate processes?

3 Answers 3

2

killall caffeinate

or if you just want to set it for a specific time…

caffeinate -t 144000 & [in seconds]

Personally, if I want the machine to stay awake without affecting my normal sleep/wake behaviour, I just use a hot corner

Prefs > Mission Control > Hot Corners…

enter image description here

Then as I wander away from the machine I just push the cursor into the top left corner & it will stay awake til I get back.

1

If you want the system to go back to original sleep settings after a certain task is finished automatically, use

caffeinate -i /path/to/binaryoftheapp

For example:

caffeinate -i /Applications/Safari.app/Resources/MacOS/Safari

For simplicity, e.g. iTunes

caffeinate -i `ps -o command \`pgrep -f iTunes\`|sed -n 2p`

Replace iTunes with the name of your app/process. It's case-sensitive.

0

Use pmset -g assertions to see if it's running.

Then killall caffeinate to get rid of it.

Despite documentation saying that caffeinate should exit upon exiting terminal and even Ctr+C should kill it, it doesn't.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .