Change Mac "Ask for password after screensaver" delay

0

How can I change my Mac OS X Snow Leopard "Ask for password after screensaver" delay?

I've tried:

defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 3600

but won't work. I want to do this through Terminal or AppleScript.

Fábio Perez

Posted 2011-03-11T22:35:51.987

Reputation: 1 544

Answers

2

defaults write com.apple.screensaver askForPasswordDelay -int 3600

Works for me -- it'll show up as "1 hour" in the preference pane, while 14400 will be "4 hours". You need to consider that the selection in System Preferences uses hard-coded selection values, and always uses the next higher value: 61 seconds will show as 5 minutes.

Daniel Beck

Posted 2011-03-11T22:35:51.987

Reputation: 98 421

Thanks, the problem was -currentHost. – Fábio Perez – 2011-03-11T22:57:31.377

Only two files get written by System Preferences when changing the value in there: One is com.apple.screensaver.plist, the other is the host-specific counterpart in the ByHost directory, that contains only settings such as the idle time for the screensaver. – Daniel Beck – 2011-03-11T22:57:43.983