Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i start the screensaver (and lock the screen) from the os x terminal?

Tags:

macos

Is there a way to start the screensaver (and lock the screen) from a bash script?

like image 685
dan Avatar asked Dec 22 '10 00:12

dan


People also ask

How do I lock my Mac screen in Terminal?

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.

How do I make my screensaver stay on Mac?

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.


1 Answers

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 
like image 120
yurymik Avatar answered Sep 29 '22 10:09

yurymik