Hacker News new | ask | show | jobs
by tylerritchie 1921 days ago
KeepingYouAwake is nice (and I'm not about to pretend the following solution is good for everyone), however, I've found on the last couple of McBook fresh installs using caffeinate [1] from the terminal is sufficient.

I usually have a terminal open anyway and `caffeinate -d -t 999999` usually does what I want (stay awake until I come back and tell you to go to sleep). Usually it's two keystrokes away (up arrow, enter), if not, that's quick enough to type for my purposes. That said, it's a bad approach if you want to suggest it as a tool for someone's workflow who _doesn't_ have a terminal open all of the time.

[1] https://ss64.com/osx/caffeinate.html

3 comments

You can omit the -t and it will run forever.
I tend to use caffeinate to wrap scripts only. I want it to go to sleep and stop eating all my electricity when it’s done.
you can throw an alias in your .bashrc or .zshrc and have it even easier...

alias caffeine="caffeinate -d -t 999999"