Skip to content

Instantly share code, notes, and snippets.

@bebrws
Last active October 29, 2019 10:01
Show Gist options
  • Save bebrws/6a4366768e6558a77436c31fb719f944 to your computer and use it in GitHub Desktop.
Save bebrws/6a4366768e6558a77436c31fb719f944 to your computer and use it in GitHub Desktop.
Completely 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
sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1;
# And to go back to normal:
sudo pmset -a sleep 1; sudo pmset -a hibernatemode 25; sudo pmset -a disablesleep 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment