Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment