If you are using Automator for this can't you just package the script as an app and assign a hotkey combo or leave it in the Dock for quick access? Edit: Didn't notice this in Keychain preferences yes, it is still there in 10.8. No one is likely to come up with an alternative simply because replicating the functions already baked in to the OS is a little too redundant for anyone to put a lot of time into pursuing.Īs far as I can tell there is no "lock screen" option in Keychain in 10.8 anyway, so your preferred solution is not going to exist if you ever upgrade. This is the built-in way to lock the screen. I use ctrl-shift-eject to lock the screen. If you just don't want to be bothered to enter a password when you are sitting in front of the computer and working, then increase the screensaver delay to a longer time before it activates, or add a 1 min delay between screensaver and password prompt so that you have a chance to catch it before it locks you out. Just set the sleep timeout to a long delay. If you don't want apps to sleep, then make sure the system power settings are such that it will not enter system sleep before you return. In all cases where GUI access is required I just need to input the password SSH uses key pair so no password is requested. I have this option set (using ControlPlane to activate it at work and deactivate it at home) and I have never once had the system refuse to respond to a Remote Desktop, VNC, or SSH connection. If you require a password on screensaver, it will not stop processes from running or block you from remotely accessing your Mac. I'm not quite sure I understand your issue here. I've only used this for a few minutes, so there may be some other issues with it I'm not aware of, but it seems to fit the bill. I was confused because I expected to see a password field. when the screen is locked, type your password to unlock it. It does not require the use of password with screensaver, it's all completely separate. The app will let you set a password (separate from your account password). There's also a menu bar item which you can click to lock the screen. It's a free (donations accepted) app which will let you assign a keyboard shortcut to lock the screen. However, if you are not averse to a solution using a 3rd party app, I think the answer to your question is "No, there isn't a command line way to do this."īecause this is a menu bar item, it's not something that you can access easily using Keyboard Maestro or another similar tool. In the usual way in The Keyboard Shortcuts. You then give the service a Keyboard shortcut. Tell (menu bar item 1 of menu bar 1 where description is "Keychain menu extra")Ĭan be used in a Automator 'Run Applescript' Action in a Automator Service Workflow. This applescript code: (updated, sourced from Using AppleScript to lock screen, confirmed working in El Capitan) tell application "System Events" to tell process "SystemUIServer" Using key codes to navigate menus can be hit and miss.Īnd as much as I do not like GUI scripting because it can also be hit and miss imho it is less hit and miss in this case. Old answer for previous OS below Arondson answer goes into using some key codes to navigate the Keychain Lock Screen menu.Īll the key codes can be bypassed using GUI Scripting to Actually hit the menu items directly. This has the default keyboard short cut of crtl + cmd + Q The Lock Screen for keychain no longer is available in current version of the MacOS Mojave & High Sierra.Īpple have now add a Lock Screen Menu item in the Apple menu. Id instance = init] Ĭlang -framework Foundation main.m -o lockscreenĮxecute the program by typing. NSBundle *bundle = Ĭlass principalClass = # Do our work in the temporary directory that gets cleaned on boot You can create a small binary for locking your screen by pasting this into your terminal. This solution works perfectly as long as Apple doesn't change the relevant parts in the keychain menu plugin. Today I just had some time to play around and found a way to programmatically actually call the functionality from the keychain menu plugin. I was also looking for a solution for this. Note: This solution is unique in that it uses the Keychain Access menu bar status functionality, but it does not require you to enable the Show keychain status in menu bar option as the AppleScript methods do.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |