Hacker News new | ask | show | jobs
by 0xEFF 1996 days ago
The caffeinate command is built into macos.

Edit: This keeps the computer awake until 6 PM each day.

  caffeinate -u -i -s -t $(($(date -j -f "%a %b %d %T %Z %Y" "$(date +"%a %b %d 18:00:00 %Z %Y")" "+%s") - $(date +%s)))
2 comments

That command makes me really glad Amphetamine exists.
Handy, but not exactly easy on the eyes. I usually just us the -t flag to pass it seconds, like 'caffeinate -t 3600' to prevent sleep for the next hour.