Sleep Escape Mac OS
The other day, I created a mixed text/video blog for the Mac911 column discussing the Safe Sleep feature on newer laptop Macs. Read the article for a more detailed description, but basically, Safe Sleep puts the contents of your machine’s RAM onto the hard drive each time you put it to sleep. In the event that your Mac loses power completely while sleeping (the battery falls out, you lose the machine for three weeks, etc.), you won’t lose any of your work. (This also means you can easily swap batteries on that long cross country flight.) Instead, your machine enters a hibernation mode, whereby it’s using no power at all. When you next connect power, Safe Sleep will read the contents of the hard drive back into RAM, letting you come right back to where you were—with open applications and documents intact.
Select the Apple menu and move to System Preferences. Click on the Energy Saver option. Do one of the following: Decide on the amount of time the device/screen should wait before falling asleep. Note: IOPMAssertionCreateWithName is new API available in Mac OS X 10.6 Snow Leopard. IOPMAssertionCreateWithName allows an application to return a return a brief string to the user explaining why that application is preventing sleep. System sleep in OS X systems is convenient to have for saving power without interrupting your workflow, especially for laptop systems. On your Mac, choose Apple menu System Preferences, then click Energy Saver. Open Energy Saver preferences for me. Do any of the following: Set your Mac to go to sleep and wake up at a specific time: Click Schedule in the bottom-right corner, then select the options you want to use. See Schedule your Mac desktop computer to turn on or off. Set the amount of time your computer or display.
There are some downsides to this, however. You’ll give up some hard drive space, for instance—an amount of space equal to your machine’s RAM, plus another 750MB. So on my MacBook, that’s 2.75GB of drive space, or just under 4 percent of my drive’s capacity. In addition, putting the machine into sleep mode takes notably longer. If you watch the video I created, there’s a delay of 10 or so seconds between the time the lid is closed and the power light goes from solid to its normal gentle blinking state. It’s during this time that the machine is writing the contents of RAM to the hard drive. As I noted, in theory nothing should go wrong if you decide to open the lid during this period (when you realize you forgot to print that one important document, for instance). However, there are quite a few stories of people doing just this, and winding up with a machine with a black screen, requiring a full restart to recover.
If these downsides are too much for you, and you’d rather have the old “unsafe” sleep mode back, it’s pretty easy to do just that. It will require a quick trip into Terminal (in /Applications -> Utilities).
Check the current setup
After you launch Terminal, the first step is to determine which sleep mode your Mac is currently using (in case you wish to go back to it). You can both view and change the sleep mode using the Unix program pmset
. To see your current settings, type pmset -g grep hibernatemode
. You should see something like this:
Great, so your machine is using mode 3
, whatever that might be. Well, thanks to the documentation for the handy Deep Sleep Dashboard widget, which puts your machine immediately into hibernation mode (so you don’t have to yank all the power sources to invoke it), we can tell exactly which mode is which:
0
– Old style sleep mode, with RAM powered on while sleeping, safe sleep disabled, and super-fast wake.1
– Hibernation mode, with RAM contents written to disk, system totally shut down while “sleeping,” and slower wake up, due to reading the contents of RAM off the hard drive.3
– The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically.5
– This is the same as mode1
, but it’s for those using secure virtual memory (in System Preferences -> Security).7
– This is the same as mode3
, but it’s for those using secure virtual memory.
That will take the output of the pmset
command, strip out everything other than the hibernatemode
value, and then dump the result into a file on your desktop named current_mode.txt
. Save this file for future use.
Note: I’m being overly cautious here on purpose. The reality is that, unless you’ve messed with this setting before, your Mac will either be in mode 0
(in which case, this tip doesn’t matter, as your Mac is using old-style sleep), or mode 3
or 7
(the default for machines shipped since last fall). Saving a text file to remember a 3
or a 7
is really overdoing things, but at least you won’t be able to say you don’t remember which mode your machine was in.
Change the sleep mode setting
To change your sleep mode, you use pmset
again, providing the variable and value you wish to assign. So to return to the old style sleep mode (which is mode 0
from the above list), enter this command:
Press Return, and you’ll be asked for your password. Provide it, and your sleep mode has been changed. If you ever wish to go back to your previous setting, just repeat the above command, but replace 0
with the value from your current_mode.txt
file.
And yes, this means you can also set your machine to always go directly into hibernation mode by running the above command with 1
at the end. I find it much simpler, though, to use the Deep Sleep widget linked above—and the widget also returns the hibernatemode
setting to its prior value, which means that you can use the widget for hibernation, and still enter normal sleep mode when you simply close the lid.
Note that restarting is not required for these changes to take effect.
Recover some drive space
If your machine was previously set to mode 3
(or 7
) and you’ve reverted to the old style sleep mode, you’ve got one more step to take: recover the drive space used up by the copy of your system’s RAM, which was created the last time you slept the machine prior to making the switch. In Terminal, enter these two commands, pressing Return after each and providing your password when asked:
If you ever return to the new style sleep mode, the sleepimage
file will be automatically recreated when you execute the sudo pmset
command—yes, it creates the file as soon as you execute the command, not the first time you put the machine to sleep.
Wrap up
Personally, I find the new sleep mode a blessing, and I’ve left my machine in that mode. If you prefer the old behavior, however, now you know exactly how to get it back. Yes, it requires a trip into Terminal land, but it’s really not that hard to do once you’re there.
There are a number of different ways to lock or sleep your screen in macOS. Before we show them to you, however, it’s important to make the distinction between locking your screen and just putting it to sleep.
If you lock your Mac you’ll put it to sleep and need to type in your login password on your Mac’s lock screen (or unlock it with TouchID on a MacBook Pro with Touch Bar, or with an Apple Watch). If you put it to sleep, you won’t necessarily lock it. In order to lock your screen, you need to set up the password in System Preferences. Here’s how to do that.
How to set up a password to lock the screen
- Launch System Preferences either by clicking on its icon in the Dock or by choosing it from the Apple menu.
- Click on the Security & Privacy pane.
- Choose the General tab and check the option that starts ‘Require password…’
- Choose an option from the dropdown menu.
Sleep Escape Mac Os 11
Now, whenever your Mac goes to sleep or a screensaver starts, it will lock and you’ll have to authenticate with your user password, Apple Watch or TouchID to gain access.
Worried about your Mac’s security in public places? Get Beepify, a Setapp app that protects your Mac from theft.
Download Beepify FreeHow to lock your Mac
If you have a MacBook, a MacBook Air or a MacBook Pro, the quickest and easiest way to lock your Mac is just to shut the lid. When you do that, the Mac goes to sleep and when you open it again you’ll need to unlock it.
However, there are occasions when you’ll want to prevent anyone from seeing the screen without actually closing it. And, in any case, if you have an iMac, Mac mini or Mac Pro, it’s not an option. Here are some other ways you can lock your Mac’s display.
1. Use Apple menu
Go to the Apple menu and choose Sleep. This will display the login screen for your account and won’t unlock with a password (unless you’re wearing an Apple Watch when you do it and then it will lock and unlock immediately)
Tip: If you want your Mac to remain locked even when you’re close by and you have an Apple Watch, go to System Preferences>Security & Privacy>General and uncheck the Allow your Apple Watch to unlock your Mac option.
2. Use shortcuts
If you’re using a Mac that’s running macOS Catalina, go to the Apple menu and choose Lock Screen or press Command+Control+Q. This will lock your Mac and return you to the Login screen.
For older versions of the operating system, press Control+Shift+Power button (or Control+Shift+Eject if your Mac has an optical drive). It will lock the screen.
You can also use a keyboard shortcut to put your Mac to sleep. Press Command+Option+Power (or Eject). This works in a similar way to the previous one, but rather than just lock your Mac it powers down the hard drive, puts the CPU into low power mode and stops background tasks in order to save energy.
3. Set up a hot corner
Hot corners allow you to drag to the mouse pointer to one of the four corners of the screen to initiate an action – you can use one as a sleep shortcut on your Mac. To set it up:
- Launch System Preferences.
- Choose the Desktop & Screen Saver pane.
- Click the Hot Corners button at the bottom right of the window.
- In the drop down window, choose a corner.
- Click on the menu and choose either Start Screen Saver or Put Display to Sleep.
Sleep Escape Mac Os X
4. Use fast user switching
Fast user switching allows you to quickly log into another user account on your Mac. But you can also use it to return to the log in window, which locks your Mac. Got to System Preferences>Users & Groups and click the padlock, then type in your password. Click Login Options and check the box next to ‘Show fast user switch menu as.’ You can also choose whether to show the menu as your full name, the account name or an icon.
To lock your Mac, click the fast user switching menu at the right of the menu bar and choose Login Window…
5. Add Keychain Access to the menu bar
This option was removed in macOS Mojave but works on versions before High Sierra:
- Go to Finder.
- Choose Applications > Utilities.
- Launch Keychain Access.
- Click in the Keychain Access menu and select Preferences.
- Check the box next to Show keychain status in menu bar.
- You’ll see a lock in the Finder menu bar. Click it and choose Lock Screen to lock your Mac.
Other ways to protect your privacy
First of all, fet a Finder-like Terminal for Mac that will help you completely control the login settings. It’s called MacPilot. The app covers over 1,200 hidden macOS features. For privacy, you can go into the Login tab and customize access by users, enable the option of automatic screen locking, and edit launch items.
Sleep Escape Mac Os Catalina
If you’re looking for physical protection of your Mac, Beepify is the app you need. Whenever you have to step away from the computer in a public place, activate Beepify and it will be set to produce a loud sound in case someone tries to close the screen or disconnect charger.
One of the main reasons for locking your Mac when you step away from it is to stop prying eyes accessing your files, browser history, or anything else you don’t want them to see. CleanMyMac X has a tool that gives you even more privacy protection.
CleanMyMac’s Privacy tool allows you to quickly delete your browser history in Chrome, Firefox, and Safari. But it also allows you to delete message threads and attachments in Messages, and to remove entries from macOS’ recent files lists.
Also, CleanMyMac’s Shredder is a quick and easy way to securely delete sensitive data. You can download CleanMyMac for free and give it a try.
As you can see, putting your Mac to sleep or locking it is very easy. There are lots of different ways to do it, although some are dependent on the version of macOS you’re using. If you regularly lock your Mac to prevent others accessing it, you should ensure your login password is strong and secure.
Finally, if privacy is important, CleanMyMac has a couple of tools that can help delete sensitive data.