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