dustinrue / ControlPlane

ControlPlane - context-sensitive computing for OS X
http://www.controlplaneapp.com
BSD 3-Clause "New" or "Revised" License
1.76k stars 181 forks source link

Sierra Screensaver Password not working #462

Closed wsoyka closed 7 years ago

wsoyka commented 8 years ago

As of Sierra the screensaver password action doesn't work anymore. (They stopped using the old Key/Domain default that they used till now)

dustinrue commented 8 years ago

I'm not surprised. Each version of OS X since Mavericks has made things more difficult. Unless someone can find a way to make this feature work I'm probably going to need to disable it for Sierra.

wsoyka commented 8 years ago

I've only managed to get it to work via gui scripting - kind of, but thats not an option for ControlPlane I believe. Sadly I've got no idea where to look for the new storage location.

blitzjunge commented 7 years ago

I struggled with the same problem for some time. Finally I found a working solution:

  1. create a script "enablePW.sh" with the following content:

    !/bin/sh

    defaults write com.apple.screensaver askForPassword -int 1 defaults write com.apple.screensaver askForPasswordDelay -int 0

  2. create a script "disablePW.sh" with the following content:

    !/bin/sh

    defaults write com.apple.screensaver askForPassword -int 0

  3. tell control plane to run the script "disablePW.sh" when entering context
  4. tell control plane to run the script "enablePW.sh" when leaving context

kudos to brandonb927 with his script at https://gist.github.com/brandonb927/3195465

Please let us know if this worked for you.

tomcat335 commented 7 years ago

Didn't work for me. The UI changes when the script runs, but the change doesn't actually take effect. Any other ideas?

dustinrue commented 7 years ago

This is a difficult problem to fix because ControlPlane is tapping into some undocumented methods to control screensaver password settings. That it worked at all in the past is actually crazy. I have a feeling that newer versions of OS X require that the app requesting a change be signed properly by the proper developer, which isn't me. Future versions are going to remove this feature entirely.