Skip to content

Instantly share code, notes, and snippets.

@rca
Created November 14, 2012 23:59
Show Gist options
  • Save rca/4075721 to your computer and use it in GitHub Desktop.
Save rca/4075721 to your computer and use it in GitHub Desktop.
Keep a Mountain Lion system from ever going to sleep

Mountain Lion Narcolepsy

I have experienced Mountain Lion on a Mac mini will go to sleep regardless of the Energy Saver settings in the System Preferences. After some reading, it seems OS X Mountain Lion has very aggressive power management, which will put the system to sleep against your (my) will.

This is my attempt to create a Launch Agent, which will use the system command caffeinate to prevent sleep indefinitely.

Copy the plist into ~/Library/LaunchAgents, then, in a Terminal session, run the command to load it up:

launchctl load ~/Library/LaunchAgents/com.sprocketlight.wakey-wakey.plist

Resources

http://arstechnica.com/apple/2012/07/os-x-10-8/18/

http://useyourloaf.com/blog/2012/08/09/keeping-mountain-lion-awake.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.sprocketlight.wakey-wakey</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/caffeinate</string>
<string>-s</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment