Uncategorized

Mac sleep display command line

The end result on my system:.


  1. data toolpak excel mac 2011!
  2. How can I sleep the display from Terminal? - Ask Different.
  3. Put Your Mac or Your Monitor to Sleep Instantly with a Keyboard Command.
  4. How to caffeinate your Mac with Amphetamine!
  5. t-shirt design software for mac?
  6. Sleep a Mac from the Command Line.
  7. change language in skype mac?

Clean, quick, reliable and secure. Name required.

macos - Command to Sleep Display OSX - Stack Overflow

Mail will not be published required. All Rights Reserved. Reproduction without explicit permission is prohibited. Enter your email address below: Posted by: Tomgi says: July 22, at 3: Mathias says: John C.

How to connect external monitor with macbooks (when mac is on sleep)

July 22, at 4: Xavier says: July 23, at 9: Patrick says: July 22, at 7: Will says: July 22, at 9: July 24, at Alberto I says: July 22, at July 23, at July 23, at 1: Bob says: July 23, at 5: Rob Bates says: July 24, at 6: July 24, at 9: Mahdi says: July 24, at 2: November 13, at 4: November 14, at 3: Leave a Reply Click here to cancel reply. Shop on Amazon.


  1. Search form?
  2. Mac keyboard shortcuts!
  3. logiciel gestion du temps mac.
  4. outlook for mac 2011 crashes when printing.
  5. How to customise the power settings from Terminal on the Mac.

While I haven't been able to find a command that will sleep the display natively, there is an app you download that will do it. There are two options from here. Right click on the app from the Downloads folder and click "Show Package Contents". You will now be able to type the command sleepdisplay into Terminal or through SSH and the display will immediately go to sleep. The premise is that pmset can set a time until display sleep, but the problem is that a value of 0 turns the feature off, rather than setting the delay to zero, and a value of 1 is a full one minute delay.

In Tiger and earlier, a different magic number was needed, because a different bit-sized variable was used internally to store the delay, in minutes, until the display turns off. This mimics the behavior of control-shift-eject, and can be used on MacBook Airs without an eject key. The command name suggests that it might put the entire system to sleep under some circumstances, but I could not make that happen in limited testing: I tested it with a shell script I started shortly before executing this command, and that was running for a few minutes until I "awoke" the system.

It had continued to print output during the entire time. Really hope this answer isn't too off the beaten track. My favourite way to sleep, restart, shut down - and most importantly lock - a Mac is using Alfred the app launcher.

Your Answer

You could use the pmset command to change the value for displaysleep, something like. Take a look at the open source github project maclock. Well, this is an old one, but it seems there aren't really good answers for this question anywhere. I've gotten an AppleScript to work, though it requires a third-party, unmaintained, and un-registrable app—Extra Suites. It can be downloaded on the developer's old website. I've also incorporated it into an Alfred Workflow. Using Alfred free at the AppStore is a great way to put the display to sleep by just writing: Doesn't get simpler than that.

How to lock your Mac

Of course Alfred does much more than that, you can also restart, logout, empty trash, lock, shutdown and many more things. The app Launchbar works equally well as Alfred. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service , privacy policy and cookie policy , and that your continued use of the website is subject to these policies. Home Questions Tags Users Unanswered. How can I sleep the display from Terminal? Ask Question. I'd like to be able to turn my screen off from command line.

Is there a way? This might help: You can also read this: Based on feedback from commenters, this is not available in OS X Sarah G Sarah G 1 6 5. It's not in Then search "run shell script" in the "actions" tab. Drag it to the right side. Instead of "cat" put "pmset displaysleepnow" as proposed above.

Select "no input" from the "service receives selected". Assign any shortcut you like. As a sidenote: Hope this helps! Matt Love Matt Love 5, 21 I guess this is the best way. I'll up vote this as soon as I'm allowed again. I've reached my limit for today.

Hint Options

Yeah, Lloeki is right. My bad! No we're not getting confused. This is dictated by the FHS. Just create it.

How to lock your Mac or put your screen to sleep in macOS

Then you can just type sleepdisplay and it will, even over ssh, dim the monitor. I just tested this on my iMac, ssh'd from my MacBook Air. Both running Here's a simple shell script that will do it. I like this one.