![]() |
Make Screensaver require a password, when specified...
I'm constantly coming and going to and from my computer, and so the screensaver frequently comes on and off. I used to have it set to require a password, so I could protect my stuff, but with the coming and going, it got a bit tiring entering a password each time, so I turned require a password off. But sometimes I leave it for short periods of time, and it's fine to have it off, but other times, I leave and I want it on! I don't want to keep going to System Prefs to change it, is there a way to have it come on only when specified? E.g., Hotkey F1 turns on Screensaver without password required, F2 turns on with password required? Or even cooler, one screen corner and another?
|
Here's what I do, perhaps it will be OK for you, I don't use a password on the screensaver, so I hit the corner when I step away. If I leave the building, don't know how long, I just log out, so a password will be needed then to log back in.
|
I have the screensaver set to require a password. I have one corner set to inhibit the screensaver. If I don't want to enter a password, I put the cursor in that corner. Otherwise the screensaver starts and I have to use the password.
Chris |
If you open Keychain Access, under the View menu is "Show status in menu bar"
Select this. In the menu bar will appear a lock. Under that lock is the option to "Lock Screen". Just select this when you leave. |
Quote:
It would be interesting to come up with something that would turn on the screensaver after 5 minutes and engage password protection after, say 15 minutes. |
Thank you. It is enjoyable to be able to contribute something now and then.
Quote:
I'm guessing that someone more knowledgeable than myself knows or can write a shell script to lock the screen (or to invoke "Lock Screen" without using the menubar item). This script could then be invoked by a function key or a key sequence using existing software. |
FWIW, the setting for whether the screensaver requests a password or not is in:
~/Library/Preferences/ByHost/com.apple.screensaver.xxxxxxxxxxxx.plist ... of the format: <key>askForPassword</key> <integer>1</integer> Where 1 is 'password required' and 0 is not. |
Thanks, djn1.
The terminal commands defaults write byhost/com.apple.screensaver.xxxxxxxxxxxx askForPassword "0" defaults write byhost/com.apple.screensaver.xxxxxxxxxxxx askForPassword "1"[/CODE] turn the request for password off and on, respectively (where the xxxxxxxxxxxx is as in the screensaver file in the directory ~/Preferences/byhost/) If one makes a clickable shell command with Code:
#! /bin/tcshCode:
#! /bin/tcshOthers will likely have a more elegant way to do this. [Edited to say that if the xxxxxxxxxxxx changes occasionally, then I don't know what to do.] |
Do you not have to prefix 'byhost/com.apple.screensaver.xxxxxxxxxxxx' with '~/library/prefences/'; i.e. specify the full path?
|
seems that this may be the preferred method of manipulating the screensaver defaults:
Code:
$ defaults -currentHost read com.apple.screensaver |
Quote:
I see that mervTormel has given the appropriate method, however. I've verified that what he has written works for me. |
Not that I doubted that what mervTormel wrote would work!
...but anytime I see a generic term like -currentHost, I think that it might be a variable which I need to replace with something referring to me (like a shortname); thus, I had to try it out to see that it works just as it is written. |
had to wrangle a bit with the defaults manpage to discover this -currentHost switch refers to this ByHost/ dir
i think |
Quote:
|
Uh, why are you guys going through all that trouble to make those scripts when the mentioned hint with the Keychain Access program works perfectly? Even if you have asking for a password off in system prefs, the Keychain menu extra allows you to lock the screen when you specifically set that menu item, but it still doesn't change the system preferences.
Isn't that what was wanted? (You could probably use MenuMaster to even assign a hotkey to it, if you don't mind using Application Enhancer.) |
Quote:
|
Quote:
|
Quote:
because you can make this change on many machines at the same time as an admin using ARD2. not everyone wants a solution that using the GUI and applies to the machine you're sitting at. |
I have tried this:
defaults -currentHost write com.apple.screensaver askForPassword 1 on two machines running 10.4.7, one Intel MacBook and one Powerbook G4. It doesn't work. The change is made to the preference file, but the computers ignore it, and the change is also not reflected in the appropriate checkbox in the Desktop and Screen Saver preference pane. I tested logging out and back in after changing the preference, and also rebooting, and it just doesn't matter. Unless I un/check the checkbox in the actual GUI, no changes I make to that setting take effect. Anyone else seeing this behavior? I need to apply this setting to a large number of managed Macs, and it's gonna SUCK if I have to go around to every machine and do it manually. edit: I just realized that the askForPassword key value is a string, so the correct command should be: defaults -currentHost write com.apple.screensaver askForPassword "1" but that doesn't work, either! ~Philly |
i bet apple doesn't support this functionality either. they will only support it not working if you change it via the GUI and it fails there. that sucks!
|
Dredging up an old thread might be counter-productive...
There's been two major updates to OS X since this thread was active 3 years ago. Is it possible that the hint described here has been superceded? (and even takes you in completely the wrong direction). |
Revisiting this old post...
I was just going through some old notes and cruft that have collected in my home folder, and found the link to this thread.
Just wanted to mention that it appears that there was a bug in 10.4.7 that has been fixed in 10.4.8-- setting the 'require password' flag in Terminal now works. The change is immediately reflected in the GUI as well. I cannot figure out which service to bounce to get it to take effect immediately, though-- right now the change only takes effect after the user logs out and logs back in (and presumably after a reboot as well). Anyone have any ideas how to force the change to take effect immediately? |
if so, the bug is still there ;)
i just try this based on another thread result on 10.6.4 .. same effect as described 3 years ago ;) phillymjs: you have figured something on this ? since its a 7 Years old Thread .. it seems a unsolvabe issue :( |
| All times are GMT -5. The time now is 03:23 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.