Show Keychain Status In Menubar
Overview
I like having the keychain icon in the status bar because it allows me to quickly lock the screen or the keychain itself:
It’s very simple to enable this:
- Press the Spotlight Search button at the top right corner of the screen (or use ⌘ + Space).
- Search Keychain Access.
- In Keychain Access, open Preferences (⌘ + ,).
- Check Show Status in Menu Bar option.
Having that Lock Screen menu item available, we can use an AppleScript to quickly lock the screen:
$ cat lock.applescript
tell application "System Events" to tell process "SystemUIServer"
tell (menu bar item 1 of menu bar 1 where description is "Keychain menu extra")
click
click menu item "Lock Screen" of menu 1
end tell
end tell
$ osascript lock.applescript
It’s also possibe to assign a key combination to the execution of the script, which will be the subject of the next tip!