Skip to content

Instantly share code, notes, and snippets.

Avatar

Laurence Ion laurion

  • San Francisco, CA
View GitHub Profile
@laurion
laurion / nosleep.sh
Last active Apr 13, 2019 — forked from pwnsdx/nosleep.sh
Completely disable sleep on any Mac
View nosleep.sh
# 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;
You can’t perform that action at this time.