Lion: When users locks computer script...simple but don't know where to put it.

Joined
Nov 18, 2009
Messages
10
Reaction score
0
Points
1
Hello,

Lion offers a fast user switching command if you go to users > login items > enable fast user switching > full name

Essentially you can lock your computer by clicking on your name in the toolbar and locking clicking "login screen"

I was wondering if it was possible to run a script to kill a certain process (just 1) when you went to the login screen. I found this file but I'm not sure its the right one.

/Library/Preferences/com.apple.loginwindow.plist.lockfile

If I write a simple shell script like this to it, can I kill the file?
> sudo defaults write /Library/Preferences/com.apple.loginwindow.plist.lockfile ps -ax | grep Application | awk '{system ( "kill "$1 )}'

Perhaps I'm not writing a shell script the right way to a com.apple file?

I also found a LogoutHook ran when the computers logouts on

sudo defaults write com.apple.loginwindow Logouthook /usr/bin/script but is this initiated at switch user time?

thanks for your help,
J
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top