Is there a way to start the screensaver (and lock the screen) from a bash script?
Press Command+Space to open Spotlight Search. Type “Terminal” in the Search bar, and then click it when it appears in the search results. Your Mac will now be in sleep mode. If you selected the option to require a password to wake it, it is now also effectively locked.
From the Apple menu, choose System Preferences. Click Desktop & Screen Saver. Click Screen Saver, and then use the slider to choose 15 minutes (or less). Click Show All to go back to the main System Preferences window.
Have you tried this?
/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine
Update for macOS High Sierra:
/System/Library/CoreServices/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With