Sleep Escape Mac OS

Posted on  by

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.

Deep Sleep 1.2 is a freeware open source DashBoard widget that will transform how you use your desktop Mac. Incidentally with the release of version 1.2 it is now compatible with Mac OS 10.6.x according to the detailed clear user guide. I'm still on 10.5.8, so I can't speak from experience on this. 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. To activate this feature, do the following: Open the Apple menu. Go to System Preferences Energy Saver. Apply the settings you want. System activity may lengthen the sleep by an indeterminate amount. This function is implemented using nanosleep (2) by pausing for seconds seconds or until a signal occurs. Consequently, in this implementation, sleeping has no effect on the state of process timers, and there is no special handling for SIGALRM.

How to set up a password to lock the screen

  1. Launch System Preferences either by clicking on its icon in the Dock or by choosing it from the Apple menu.
  2. Click on the Security & Privacy pane.
  3. Choose the General tab and check the option that starts ‘Require password…’
  4. Choose an option from the dropdown menu.

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 Free

How 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.

Sleep Escape Mac Os 11

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:

  1. Launch System Preferences.
  2. Choose the Desktop & Screen Saver pane.
  3. Click the Hot Corners button at the bottom right of the window.
  4. In the drop down window, choose a corner.
  5. Click on the menu and choose either Start Screen Saver or Put Display to Sleep.

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:

  1. Go to Finder.
  2. Choose Applications > Utilities.
  3. Launch Keychain Access.
  4. Click in the Keychain Access menu and select Preferences.
  5. Check the box next to Show keychain status in menu bar.
  6. 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.

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.

Technical Q&A QA1340

Q: How can my application get notified when the computer is going to sleep or waking from sleep? How to I prevent sleep?

A: Cocoa (Listing 1) and I/O Kit (Listing 3, Listing 4) can both be used to receive sleep and wake notifications. Cocoa can be used to receive sleep and wake notifications, while I/O Kit can also prevent or delay (Listing 2, Listing 3) idle sleep. However, even with I/O Kit, it is not possible to prevent forced sleep, only delay it.

Note: Mac OS X will sleep in two different situations- forced and idle.

  • Forced sleep occurs when the user takes some sort of direct action to cause the machine to sleep. Closing the lid on a laptop or selecting sleep from the Apple menu both cause forced sleep. The system will also induce forced sleep under certain conditions, for example, a thermal emergency or a low battery.

  • Idle sleep occurs when the machine is unused for a specific period of time configured in the Energy Saver System Preferences.

Sleep escape mac os catalina

Listing 1 Installing a Cocoa sleep and wake notification.

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. If you need to support previous versions of Mac OS X you will need to use the notification based APIs (Listing 3, Listing 4) or the deprecated call IOPMAssertionCreate.

Listing 2 Preventing sleep using I/O Kit in Mac OS X 10.6 Snow Leopard

Listing 3 Installing an I/O Kit sleep/wake notification.

Sleep Escape Mac OS

To stop receiving I/O Kit sleep notifications, you need to remove your event source from the application runloop and do a bit of cleanup.

Listing 4 Removing I/O Kit sleep/wake notification handler.


Document Revision History


DateNotes
2014-01-13

Corrected small bug in message logged in receiveWakeNote

2011-03-01

Updated code to use IOPMAssertionCreateWithName.

2008-08-08

Added information about forced/idle sleep, how to receive sleep/wake notification in Cocoa, and expanded IOKit sample to include wake messages and IOPMAssert.

2005-10-17

Added an example of how to deregister for sleep notifications.

2004-10-25

New document that explains how applications can register and unregister for sleep and wake notifications on Mac OS X.

Sleep Escape Mac Os X


Sleep Escape Mac Os Catalina



Copyright © 2014 Apple Inc. All Rights Reserved. Terms of Use Privacy Policy Updated: 2014-01-13