Just picked up the new MacHeist Bundle: http://www.macheist.com/bundle/u/110143/
March 25, 2009
June 22, 2008
Fast User Switching via Keyboard
I copied the following Bash script from MacScripter and combined it with TextExpander's ability to execute Apple Script in order to give me the ability to switch to the Login screen via a keyboard shortcut (I mapped it to 'ffus').
-
#!/bin/sh
-
# Fast User Switching from the command line
-
# I saved mine as /usr/local/bin/fus
-
-
CGSession='/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession'
-
-
case "$#" in
-
0)
-
# display login screen
-
exec "$CGSession" -suspend
-
exit
-
;;
-
esac
-
-
# No reason to display the login panel for the current user
-
case "$1" in
-
"$USER" | "$UID")
-
exit 0
-
;;
-
esac
-
-
# can pass in a (short) username or userid
-
id=`/usr/bin/id -u "$1"` || exit
-
-
# display login panel for user
-
exec "$CGSession" -switchToUserID "$id"
The Apple Script I use to invoke this from TextExpander is:
-
do shell script "/usr/local/bin/fus "
November 8, 2006
MacOS X… · home · end · page up · page down ·
I stole this from Think Again!
I am reposting it here because you never know when someone's blog may disappear...
Fortunately, it is quite easy to fix and I have two solutions for you:
1. Download and install a DoubleCommand. It fixes the home/end problem.
2. Change the key bindings in Mac OS X. Add the following code to ~/Library/KeyBindings/DefaultKeyBinding.dict (the directory and file might not exist):
{/* home */
"\UF729" = "moveToBeginningOfLine:";"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
/* end */
"\UF72B" = "moveToEndOfLine:";"$\UF72B" = "moveToEndOfLineAndModifySelection:";
/* page up/down */
"\UF72C" = "pageUp:";"\UF72D" = "pageDown:";
}