Skip to content

Instantly share code, notes, and snippets.

@MikeTheGreat
MikeTheGreat / nosleep.sh
Last active June 5, 2024 06:15
Disable sleep on any Mac
# Useful to prevent Macbooks to go to sleep when closing the lid instead of running tools that requires a Kernel Extension (e.g. InsomniaX) and more
#
# References:
# https://www.unix.com/man-page/osx/1/pmset/
# https://www.unix.com/man-page/osx/8/caffeinate/
# To stop sleep for a command: ######################
caffeinate -disu make
# To permanently change sleep settings: ######################