Need help to turn off screen on iMac macos Big Sur

Hello,


I would like to create a way to turn off the screen on my imac running Big sur.

I know the keyboard shortcut Control Shift Eject will do that, but I would like to do it from a remote connection (VNC or teamviewer)


I've created a service that will do it using automator, but ideally I would like to create an icon that I could just click on.


I tried creating an executable that runs a terminal command : pmset displaysleepnow

It does indeed work, but it leaves the terminal window open after. I tried going into preferences - profile - shell and select close window after running. The terminal window is indeed closed, but the icon remains running in the dock.


Basically, I want to be able to VNC or teamviewer to my imac from my iphone, do what I need to do, and be able to turn off the imac screen after I'm done, from my iphone.


There must be an easier way to do this than what I'm currently attempting!


Any suggestions would be appreciated


Thanks

iMac 27″, macOS 11.6

Posted on Oct 9, 2021 9:38 AM

Reply

Similar questions

9 replies

Oct 9, 2021 10:57 AM in response to tbirdvet

Because I want it to sleep immediately.

Control Shift Eject works - but I cannot do that from my phone using VNC lite

I have set hotspot upper right corner to blank the screen, but again, cannot do that from my phone using VNC


Background: its for home theatre. I'm streaming movies from my imac to my TV (appleTV using beamer app).

so I want to be able to remote in to the mac, press play on the beamer app (there is no ios app for that), and then immediately blank the screen.


The terminal command does work, but then leaves terminal windows / dock icons open , not very clean.

The services command I made does work, but would be ideal to have an icon I can put on my dock, and just click on it , and it turns off the screen.


I'm not too familiar with how to do this, but I'm sure its not that difficult ..

Oct 9, 2021 11:40 AM in response to ku4hx

Sorry if I'm not using the right terminology.


From my iphone, I will either use VNC light to screen share and control my iMac, or teamviewer.

I control my iMac from my iphone, and start the movie streaming.

When I disconnect from VNC or teamviewer, my imac screen stays on

This creates a distracting light from the screen

So I want to be able to screen share from my phone , do what I need to do, turn off the imac screen, and then disconnect.



Oct 9, 2021 12:24 PM in response to mikeypas

Ok, thanks for everyone's help.


I finally figured it out:


created an executable terminal script containing:

pmset displaysleepnow

osascript -e "do shell script \"osascript -e \\\"tell application \\\\\\\"Terminal\\\\\\\" to quit\\\" &> /dev/null &\""; exit


This turns off the screen immediately, and then closes the terminal app completely.


Renamed the executable to .app , dragged to dock, then renamed back to .command


Now I have an dock icon which will immediately turn off the screen, and leaves no trace of terminal program running.

Oct 9, 2021 10:00 AM in response to mikeypas

Under the Energy Saver settings wake on lan can be checked, and then you can turn on energy saver to make your screen go dark. Apple menu -> System Preferences -> Battery -> Power Adapter, using Wake for Network Access.


Apple menu -> System Preferences -> Security and Privacy -> General don't allow the password to happen after energy saver sleep begins, unless you are uncertain of the surroundings of the computer's security.




Oct 9, 2021 11:38 AM in response to mikeypas

Turn off which screen? Is "remote in" same as screen sharing? I share screens a lot and I definitely want my local screen to not sleep while I"m working, as to the other screen, I could not care less if it's on or off.


What's the advantage of sleeping the remote screen?


I stream from the "remote" too, but I went the low tech way and had my wife make me a cover similar to a copier cover I just drop into place. The "remote" screen is in the same room and the TV and the screen is a distraction while watching Foundation or whatever.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Need help to turn off screen on iMac macos Big Sur

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.