How to turn off the Display on your Mac with Siri Shortcuts

Screen shot of iPhone

I have my laptop plugged into an External monitor on my desk with a really long timeout before it goes to sleep but sometimes I want it to sleep sooner. At those times, I may not want to walk up to my desk, grab the mouse and then click through menus just to save a few Watts. It’d be great if I could ask Siri to do this for me. I’m not lazy, I’m efficient!

To do this, I had hoped that there was an easy way to do it and after some digging around — it really was very straight forward. Here’s how I did it:

Step 1 – On your Mac – Enable “Remote Login”

Screen shot of sharing screen from system preferences

  • On your mac, open System Preferences and then Sharing.
  • Once there, click on the Remote Login check box.
  • Make a note of the name for your mac on your local network. You’ll need this in the next step.

Step 2 – Create the Siri Shortcut on your iPhone or iPad

 

Screen shot of ssh shortcut on iPhone

  • Open Shortcuts on your phone or tablet.
  • Click on the + on the top right to create a new shortcut.
  • Name the new shortcut whatever you’d like to use — I’ve selected “Turn off the display“.
  • Click on Add Action, search for “ssh” and click “Run Script Over SSH“.
  • Once the action is selected, click on “Show more“.
  • Enter the following fields:
    • Host – You can either use the hostname from Step 1 or if you know it, your Mac’s IP address.
    • User – Your username on your mac
    • Password – Your password on your mac
    • Script – pmset displaysleepnow
  • Click Done on the top right

The first time you ask siri to turn off the display, it will prompt you to accept security keys. Say yes to that and you’re all set. If you have other devices on the same Apple account, in a few minutes this short cut will work there too.