Skip to content

Instantly share code, notes, and snippets.

@laurion
Last active February 27, 2024 06:19
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laurion/d93eb70efcc6f3b3716173c94e74f435 to your computer and use it in GitHub Desktop.
Save laurion/d93eb70efcc6f3b3716173c94e74f435 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 (for Macbook):
sudo pmset -a sleep 1; sudo pmset -a hibernatemode 3; sudo pmset -a disablesleep 0;
# If you have desktop, to go back to normal run this: 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