21

Shift + Control + Eject will turn off a Mac's display.

I just bought a new MacBook Air. It has a power button instead of an Eject key:

Power Button on MBA

Besides a hot corner or turning down the screen brightness, is there a keystroke that will sleep the display?

3
  • 1
    Did you see my suggestion below? Did it meet your needs?
    – TJ Luoma
    Sep 23, 2011 at 2:52
  • 2
    I'm sorry TJ, it's just a bit too hack-y for me. ⌥ + screen corner works well enough for me.
    – Graham
    Oct 10, 2011 at 0:52
  • 1
    Fair enough. I can definitely understand that.
    – TJ Luoma
    Oct 10, 2011 at 5:44

7 Answers 7

12

Just Shift + Control + Power works on my retina MBP, which also doesn't have an eject button.

4
  • This is the correct answer, and works on my Macbook Air. All the scripts and hacks are unnecessary.
    – cablesm
    Dec 20, 2012 at 21:30
  • 1
    Yeah, it has been possible to substitute the power key for eject since 10.8.
    – Lri
    Dec 21, 2012 at 10:53
  • Can confirm - Works on my Macbook Air with Yosemite as well.
    – Deb
    Nov 29, 2014 at 16:50
  • support.apple.com/en-gb/HT201236 - lists all shortcuts Apr 13, 2015 at 21:36
3

http://dl.dropbox.com/u/18414/ase/DimScreen.tar.bz2 is my attempt at a solution to this.

It is an Automator Application which does two things:

  1. It runs a script to dim the screen to 0 (see note below)

  2. It launches your screensaver.

Why does it launch your screensaver? Well, because I assume that if you are dimming your screen that means you are going to be gone from it for awhile.

If the brightness is set to 0 and you come back to your Mac and press some keys, move the mouse, etc nothing will happen. Well, nothing you can see.

However if the screensaver is running, the Mac is smart enough to bump up the brightness just a litte to show you that you need to enter your screensaver password.

(You DO require a password to unlock your screensaver, right?)

Well, even if you don't, you can still use the app. After the screensaver exits, the script will bump the brightness back up just a little.

(If you find that the screensaver is being turned off by accident and you don't want that, you can just edit the last few lines of the script, and copy/paste it into a new app.)

NOTE / WARNING / DISCLAIMER / ACHTUNG

dimscreen.zsh is the script which is run by the application (it is part of the .tar.bz2 file). HOWEVER this script depends on the 'brightness' command being present at $HOME/bin/brightness, which it probably is not.

If the app does not find it there, it will attempt to download it from http://luo.ma/attic/brightness.bz2 and install it to ~/bin/brightness.

If the idea of downloading a file from the Internet skeevs you out, you can find the source code at http://mattdanger.net/2008/12/adjust-mac-os-x-display-brightness-from-the-terminal/ and compile your own (that page has instructions, it is dead simple).

I have included the source code as well as the precompiled binary in the .tar.bz2 file as well.

(As for the "Keyboard Shortcut" part of your question, I leave it to you to decide which of the many app launchers you will use, including something like Apptivate which can tie it to a single keystroke if you like.)

3

Though the question explicitly says "besides a hot corner", I'll mention it since it's the only way I've found so far to get display sleep at all on the new Air.

Open Preferences, go to "Desktop & Screen Saver", choose the "Screen Saver" tab, click "Hot Corners…". Open the dropdown for the corner you'd prefer and pick "Put Display to Sleep".

If you move the mouse cursor to that corner, the display will go to sleep.

If you hold Cmd (or some other modifier, or combination of modifiers) and then open the dropdown, display sleep will only trigger if you move the mouse and hold that modifier, which could reduce mistakes.

0
2

The free app Sleep Display works fine on my Air, running OS X Lion. It's just a SleepDisplay.app that does what it says.

I just launch it by name via Alfred, but you could probably bind it to keyboard shortcuts with any of a number of tools, like FastScripts.

2

This isn't a keystroke, but it's a step in the right direction: If there were a way to get past the fact that the script needs to be run with sudo, you could use Automator to bind it to a keyboard shortcut:

#!/bin/bash
original_setting=`/usr/bin/pmset -g | /usr/bin/grep displaysleep | /usr/bin/awk '{print $2}'`
echo $original_setting
magic_number=2147483648
/usr/bin/pmset -a displaysleep $magic_number; sleep 1; /usr/bin/pmset -a displaysleep $original_setting
1
  • I'll try using Fastscripts to wrap this up - might be perfect for my needs.
    – bmike
    Apr 2, 2012 at 4:14
1

The eject key is now on the F12 key. Give Shift+Control+F12 a try.

9
  • Nope. There's no eject key. Tried Shift + fn + Control + F12.
    – Graham
    Aug 7, 2011 at 23:48
  • Did you try Shift + Control + F12 without the FN? Aug 7, 2011 at 23:52
  • Yes. I tried that.
    – Graham
    Aug 8, 2011 at 0:16
  • 1
    That's odd. I just tested it on my MacBook Air and it's working fine. You're not running Caffeine or anything that would keep it awake are you? Aug 8, 2011 at 0:52
  • Will it only work on MacBook Airs? I just tested it on the MacBook Pro here at the office with an eject key and can't turn the display of via Control+Shift+F12.
    – DASKAjA
    Aug 31, 2011 at 12:24
1

There is a keyboard shortcut already mapped in the OS for doing this, you don't need to map anything or write any scripts.

Sleep all displays: Control+Shift+Fn+Power Button

Works on Mountain Lion and Mavericks (possibly others as well). It works on my MacBook Air running Mavericks (10.9.2).

Source: http://support.apple.com/kb/PH11242

1
  • 1
    the fn button makes that key combination not work for me.
    – dwightk
    Mar 11, 2014 at 20:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .