LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   How to run programs at exiting the graphical desktop (https://www.linuxquestions.org/questions/linux-desktop-74/how-to-run-programs-at-exiting-the-graphical-desktop-473006/)

marozsas 08-11-2006 11:20 AM

How to run programs at exiting the graphical desktop
 
Dear friends,

How to run programs at exiting the graphical desktop ?

I know that I can put commands in ~/.bash_logout to run programs at the end of a login shell, but it does not work because my graphical session (KDE/Gnome) are started by a graphical desktop manager, and I never got a true login shell in that way.

Also, I don't want that every single shell runs a logout script at exit; only when I close the window manager.

any hints or ideas are welcome,

unSpawn 08-12-2006 06:36 AM

If you (can) use Gdm, check out /etc/X11/gdm/PreSession and /etc/X11/gdm/PostSession.

marozsas 08-16-2006 06:28 AM

Hi unSpawn !

Thanks for the hint and sorry the delay. I was busy at work and just now I had some time to play with my system.

Yes, you're right. In FC5 the file is /etc/gdm/PostSession/Default which is executed for every user at exit of the window manager.

I just had to add some code to execute a user script .
Code:

if [ -x ${HOME}/.postsession ]; then
      ${HOME}/.postsession
fi

Thank you !


All times are GMT -5. The time now is 11:02 AM.