3

I want caffeine 2.8.3 to be active as soon as it starts up. To achieve this I thought there would be a cli option, but the help page caffeine -h does not revel any hints.

How can I start caffeine in active mode?

1 Answers1

5

Try this, not elegant, but it works for what you want.

caffeinate sleep 9999999

caffeinate will keep the computer await until the next command finishes. In this case, it will keep your computer up for just under 116 days or until you logout or shutdown.

caffeine itself is primarily for when programs run full-screen. It will prevent sleeping the entire time that program is in full-screen. caffeinate was designed to be run for other programs you don't want to be interrupted (such as a big update, non-full-screen game, or something like that).

Although there is probably some way to activate the caffeine indicator automatically, this is the best I can do for the time being.

Also, if you want to kill it to allow sleeping at any time, run pkill caffeinate.

You could also just change your computer settings to never sleep/darken screen/screensaver at all, then you don't need to worry about it.