On Thu, Oct 21, 2004 at 11:59:19PM +0200, Magnus Therning wrote: > On Wed, Oct 20, 2004 at 02:19:05PM +0100, Karl E. Jorgensen wrote: > >On Wed, Oct 20, 2004 at 12:50:18AM +0200, Magnus Therning wrote: > >> Currently I have a few jobs I run at boot time using @reboot in my > >> crontab. I would really like to be able to run some jobs just before > >> shutting down as well (alternatively when I log out of GNOME). How can I > >> do that? > > > >To run them when you log out, you can put them in your ~/.xsession > > > > #!/bin/sh > > gnome-session > > ~/bin/job-to-run-after-logout 1 > > ~/bin/job-to-run-after-logout 2 > > ... > Hmm, this was a really good suggestion.
Glad you like it! > I didn't do it exactly like this, instead I decided to put GDM to use. I > added the following lines to /etc/gdm/PostSession/Default : > > if [ -x ${HOME}/.Xpost_session ]; then > su - ${USER} --command=${HOME}/.Xpost_session > fi > > The I put an executable script called .Xpost_session in my home > directory. It basically has the following format: > > #! /bin/zsh > > job1 &>| ~/.Xpost_session.err > job2 &>>| ~/.Xpost_session.err > > It all works wonderfully. Can it be done better, or more efficient? I like that better, actually :-) But I think it would be "cleaner" if the redirection was done in /etc/gdm/PostSession/Default or just appended to ~/.xsession-errors (perhaps it is still redirected at that point? haven't looked) Hopt this helps -- Karl E. Jørgensen [EMAIL PROTECTED] http://karl.jorgensen.com ==== Today's fortune: filesystem not big enough for Jumbo Kernel Patch
signature.asc
Description: Digital signature