I just need a logout script that will run when the user logs out of the graphical windows system. Being a newbie I do not know whether that is actually logging out of X completely or just the desktop (gnome).

We are using tcsh as the default shell for the users. I have tried setting a logout script both in the etc directory (/etc/csh.logout) and in the users home directory (.logout), but when logging in via the graphical login, the script does not run on logout. However, if the user logins in via the non-graphical (command line) login, then logs out from there, the script runs.

Help!! Thanks in advance.