Re: How to start an application automatically after X is started up?
thank you all,
I am going to read the manual carefully
----- Original Message -----
From: "David Berg" <email@example.com>
To: "Deephay" <firstname.lastname@example.org>
Cc: "debian_user" <email@example.com>
Sent: Thursday, February 16, 2006 11:57 PM
Subject: Re: How to start an application automatically after X is started up?
> On 2/16/06, Deephay <firstname.lastname@example.org> wrote:
>> I have tried to add a line "xscreensaver -no-splash &" in the ~/.xsession file
>> but the X cannot be started up currectly, it will return to the tty1 finally after
>> the "startx" command was issued.
> I think I know what the problem is now. When you put `xscreensaver`
> in ~/.xsession is that the only line there? If so I'm also going to
> guess that when you removed the line to use the other method you did
> so by deleting the file.
> If that is the case the problem is that when there is an .[xX]session
> file in your home directory the startx (among others) command
> terminates when the last command in that file has executed. In your
> case once xscreensaver has been put in the background control is
> returned to your shell since the process has finished.
>> But now the problem is solved, I created a file "98scrsvd" with a line
>> "xscreensaver -no-splash &" in it in /etc/X11/Xsession.d/ and now it works
>> The prefix "98" indicates it will be sourced at last (the X is already started up).
> By creating this file you are letting the Xsession scripts pass over
> the ~/.[xX]session file as its startup command and move to the next in
> the list which is x-session-manager followed by x-window-manager.
> To make it work with your ~/.[xX]session file you want it to contain
> the following:
> xscreensaver -no-splash &
> #Replace the following lines with what ever manager you want
> #if the defaults aren't quite right.
> if [ -x /usr/bin/x-session-manager ]; then
> exec x-session-manager
> elif [ -x /usr/bin/x-window-manager ]; then
> exec x-window-manager
> elif [ -x /usr/bin/x-terminal-emulator ]; then
> exec x-terminal-emulator
>> But I am still not very clear what is the really sequence and usage of those .xinitrc
>> and the .xsession files, the manual seems not very much helpful. Anyone can explain
>> this to me? Thx a lot!
> If you haven't already read it, read `man xsession`. The xinit man
> page doesn't say this but I believe that it first looks for .xinitrc
> and if it exists, runs that. If there is no .xinitrc it runs
> /etc/X11/xinit/xinitrc which simply sources /etc/X11/Xsession.
> So when you ran startx with a .xinitrc file you were put back at a
> shell after just .xinitrc was run. When you ran startx with a
> .xsession file the /etc/X11/Xsession and /etc/X11/Xsession.d scripts
> were run then you were put at a shell after your .xsession finished.
> With neither of these files the /etc/X11/Xsession script chose a
> different startup command and returned you to the shell after your
> x-session-manager or x-window-manager terminated.
> Hope this clarifies everything. It certainly did for me.