Skip to content

Instantly share code, notes, and snippets.

@thorstenmerl
Created September 3, 2021 18:42
Show Gist options
  • Save thorstenmerl/a53627351b2b892250a0fb17863b47db to your computer and use it in GitHub Desktop.
Save thorstenmerl/a53627351b2b892250a0fb17863b47db 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
# Before doing anything, save your current configuration using
pmset -g
# To disable sleep
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 [original hibernatemode value]; sudo pmset -a disablesleep 0;
@thorstenmerl
Copy link
Author

default was:

System-wide power settings:
Currently in use:
standbydelaylow 10800
standby 1
womp 1
halfdim 1
hibernatefile /var/vm/sleepimage
proximitywake 1
powernap 1
gpuswitch 2
networkoversleep 0
disksleep 0
standbydelayhigh 86400
sleep 0
hibernatemode 3
ttyskeepawake 1
displaysleep 20
tcpkeepalive 1
highstandbythreshold 50
acwake 0
lidwake 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment