Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

fast user switch from the command line (See related posts)

#!/bin/sh  
MENUEXTRAS="/System/Library/CoreServices/Menu Extras"
CGSESSION="$MENUEXTRAS/User.menu/Contents/Resources/CGSession"
if [[ -z $1 ]]; then
    "$CGSESSION" -suspend
else  
    USERID=`id -u $1`;
    if [[ -z $USERID ]]; then
        exit -1;
    fi;
    "$CGSESSION" -switchToUserID $USERID
fi;

You need to create an account or log in to post comments to this site.


Related Posts