Shutdown (logout) items?

Lazarus18

In debt medical student
Is there a way to set CLI commands (or programs I suppose) to run when you logout? Getting things to go on login is easy, but I haven't seen a way to do it when you log out. My thinking is that it would be nice to have individualized system icons, and when one user logs out the default icon set is reloaded in case another user doesn't have anything customized.
 
The only way I know of is to modify /etc/ttys for the console entry; the loginwindow part can take both -LoginHook and -LogoutHook options, so you could make it say,

Code:
console "/System/Library/CoreServices/loginwindow.app/loginwindow
-LogoutHook /usr/local/bin/logoutscript"
vt100 on secure
window=/System/Library/CoreServices/WindowServer
onoption="/usr/libexec/getty std.9600"

(Note that's all one line). See the SystemOverview documentation (/Developer/Documentation/Essentials/SystemOverview/SystemOverview.pdf if you have DevTools installed), page 99
 
Back
Top