Friday, May 28, 2010

Enable Screen Saver Locking From the Command Line: Snow Leopard

The settings are now stored in ~/Library/Preferences/com.apple.screensaver.plist:

$ defaults read com.apple.screensaver
{
    askForPassword = 1;
    askForPasswordDelay = 5;
}
$

To turn on the screen saver lock:

defaults write com.apple.screensaver askForPassword -int 1


To turn off the screen saver lock:

defaults write com.apple.screensaver askForPassword -int 0 

No comments: