
This let's you enter the Unpowered Clamshell Mode by simply clicking the DontSleep.myscript icon in your Dock before closing the lid. Now you can drag the whole PauseSleep folder onto your Dock.Sudo echo "Reverting any still-un-revered settings and going to sleep." # Note: This file is optional but good to have in case you somehow get stuck in No Sleep mode.
#CONNECTING MACBOOK TO MONITOR CODE#
Copy all the following code into the file. Now, right click Sleep.myscript and choose Open With > Other > TextEdit.app.|"Įcho "| If lid is not closed within 1 minutes, clamshell mode will be |"Įcho "| reverted to default to prevent you from from forgetting about it. # Waiting for a second then printing info for the userĮcho "/-\\"Įcho "| You may now close this window and shut the macbook lid. Nohup ~/Desktop/PauseSleep/DontSleepHelper.sh & # Launching the helper as a standalone process Do not run manually." > ~/Desktop/PauseSleep/DontSleepHelper.shĮcho "sudo pmset -a disablesleep 1" > ~/Desktop/PauseSleep/DontSleepHelper.shĮcho "rm -f ~/Desktop/PauseSleep/DontSleepHelper.sh" > ~/Desktop/PauseSleep/DontSleepHelper.shĮcho "sleep 60" > ~/Desktop/PauseSleep/DontSleepHelper.shĮcho "sudo pmset -a disablesleep 0" > ~/Desktop/PauseSleep/DontSleepHelper.shĮcho "exit 0 " > ~/Desktop/PauseSleep/DontSleepHelper.shĬhmod 755 ~/Desktop/PauseSleep/DontSleepHelper.sh
#CONNECTING MACBOOK TO MONITOR UPDATE#
No fiddling required.Įcho "Enter password to update sleep settings: "Įcho "# This is a helper script. Simply copy-and-paste all the following code into the file.

Now, right click DontSleep.myscript and choose Open With > Other > TextEdit.app so we can edit the file. (This step is important because it will later let you click-to-run your script.) This will ask you what application to open the file with: Choose Utilities > Terminal.app. Go to Desktop > PauseSleep and double click on DontSleep.myscript.

Below you will find a fully-native way to do this on a Mac without any third party apps. Lucas Fais's answer about Amphetamine is great, but if you don't trust third party apps, or don't want to support something called "Amphetamine".
