I'd like to press a key combo to get my computer to the lock screen. In Windows the shortcut was Windows keyL. On Mac I press CMDALTPower which turns the laptop off and puts it into sleep. I want to just have it go to the lock screen with the monitor staying on.
High Sierra and higher(?)
As usual every system update changes something. There is now a Apple Menu item control+⌘+Q that locks the screen!
Sierra and lower
You can add the Lock Screen to your Menubar.
In Spotlight (⌘ + Space) search for
Open Preferences (⌘ + ,)
Show keychain status in menu barThis will show a lock in your Menu Bar with an option
Application Shortcutssection, add a new item for
All Applicationswith the Menu Title of
Lock Screenand a Keyboard shortcut that you like.
This way you don't have to change your Screensaver timeout and you can lock your machine much like you do in windows. Note that You may also need to Logout and back in for any changes to the shortcut to take effect.
I use BetterTouchTool to do just this. Once downloaded and running:
- Click the "Keyboard" tab and select "Global" in the left-hand "Select Application" pane
- Click "+ Add new keyboard shortcut" at the bottom of the shortcut list
- Click the "Keyboard shortcut" recording field and hold down the keys you wish to use for the shortcut, I use ⌘ + L (which feels most like the Windows key + L on Windows systems)
- Click the "Trigger predefined action" dropdown and select "Open application/file/script..."
- Navigate to /System/Library/Frameworks/Screensaver.framework/Versions/A/Resources and select "ScreenSaverEngine.app" and click "Open"
Alternatively, instead of steps 4 and 5, click the "Trigger predefined action" dropdown and select "Lock Screen" which locks the screen without triggering the screensaver.
Now hitting ⌘ + L will trigger the screensaver (and lock the computer, provided you followed the advice in the answer from @Buscar 웃 above to require the password when the screen saver or display sleep begins). You can also set BetterTouchTool to launch when the computer starts so your hotkey always works.
Quoting myself from https://github.com/tjluoma/lockscreen:
Download and install FastScripts (which is free for up to 10 keyboard shortcuts)
Download and install LockScreen.scpt and save it to ~/Library/Scripts/ (you may have to create that folder if you haven't used it before.
Assign the keyboard shortcut of your choice to
LockScreen.scptwithin FastScripts preferences:
Note: while the OP did not want to sleep the screen display, that can easily be done too. Just download Sleep Display and install it to /Applications/ and use SleepAndLockScreen.scpt instead of
There is a wonderful tool Karabiner that can help you with this (and many more):
Properties->Misc&Uninstall -> private.xml
<root> <!-- Place this file to ~/Library/Application Support/Karabiner/private.xml --> <item> <item> <name>Screensaver Lock screen (Ctrl-Cmd-L)</name> <identifier>myconfig.lock</identifier> <autogen>__KeyToKey__ KeyCode::L, ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L, KeyCode::VK_OPEN_URL_APP_ScreenSaverEngine</autogen> </item> </item> </root>
Then activate the
Screensaver Lock screen (Ctrl-Cmd-L) in the
Change Key screen.
Update [1 Feb 2018]: The Karabiner was deprecated and replaced with Karabiner-elements. So achieving this may be as simple as mapping the MAC
POWER button to some button on the keyboard. I use
PAUSE button for that. Then locking screen would be
Ctrl-Shift-Power and suspending -
Logging out to the fast user switching screen:
- Add a shell alias or a keyboard shortcut for
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend.
- Enable the fast user switching menu from the Users & Groups preference pane, and then select Login Window… from the menu.
- Use the lock action in Alfred.
Locking the screen:
- Check "Require password immediately after sleep or screen saver begins" in the Security & Privacy preference pane. You can then lock the computer manually by pressing control-shift-eject to turn off displays, by pressing option-command-eject to go to sleep, or by running
open -a ScreenSaverEngine.
- Enable the Keychain menu extra in the preferences of Keychain Access, and then select Lock Screen from the menu.