mathiasbynens / dotfiles

:wrench: .files, including ~/.macos — sensible hacker defaults for macOS
https://mths.be/dotfiles
MIT License
30.02k stars 8.74k forks source link

Screensaver askForPassword and askForPasswordDelay not available since 10.13 #922

Open Olivier61 opened 4 years ago

Olivier61 commented 4 years ago

Hi,

Since 10.13, ‘defaults read com.apple.screensaver’ returns only 1 entry: ‘tokenRemovalAction’. ‘askForPassword' and ‘askForPasswordDelay’ vanished ...

I don’t know where these values are stored since 10.13, nor how to read them.

If you know, I’d be grateful !

Cheers

Olivier61 commented 4 years ago

Sorry, I was looking at open issues, didn’t see previous posts. Closing this one.

blaues0cke commented 4 years ago

Here is a small script to find differences in your defaults:

#!/usr/bin/env bash

defaults read > settings-before.txt

echo "Toggle your setting and press any key"
read

defaults read > settings-after.txt

code --diff settings-before.txt settings-after.txt
Olivier61 commented 4 years ago

@blaues0cke Unfortunately, changing these settings doesn’t make any changes in defaults, at least under macOS 10.15.4. The script doesn’t return any difference. These were in defaults com.apple.screensaver up until 10.12, now they are gone.

Thanks anyway for helping !

tresni commented 1 year ago

Per kolide I took a look at sysadminctl. Looks like on MacOS 12 at least you can do sysadminctl -screenLock immediate -password - . You can use sysadminctl -screenLock [seconds] -password - to set a delay. This does prompt for your password, using sudo doesn't bypass that. In theory, you could prompt for the password at start and possibly pipe in or append via variable argument.

Same for #809