Created
December 23, 2015 19:12
-
-
Save pudquick/350ba6411df3be77d32a to your computer and use it in GitHub Desktop.
Programmatically immediately lock the screen of a Mac running OS X, regardless of security settings, screensaver settings, or Fast User Switch settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import CDLL | |
loginPF = CDLL('/System/Library/PrivateFrameworks/login.framework/Versions/Current/login') | |
result = loginPF.SACLockScreenImmediate() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment