title: Lock screen by API in macOS
body: <p>Is there an API, that can lock the screen as the menu bar entry you can add from <code>Keychain</code> preferences?</p>
  
  <p>This <code>Keychain</code> function is (was) locking the screen but not bringing the system to sleep.</p>