title: OSX: check if the screen is locked
body: <p>Is there any way to check if screen is locked in shell or applescript?
  Not just check if screensaver is running, but screen is locked by energy saver settings or by pressing <kbd>⌃⇧⏏</kbd> (<kbd>shift</kbd>+<kbd>control</kbd>+<kbd>eject</kbd>).</p>
  
  <p>Thank you in advance.</p>