[oclug] Starting an X Windows term

Gilles J. Seguin segg at infonet.ca
Tue Aug 28 21:30:53 EDT 2001


Joe Burpee wrote:
> 
> On 01/08/28 15:54:50, Patrick Ouellette wrote:
> > At 12:21 AM 8/28/2001 -0400, you wrote:
> > >On 01/08/27 22:54:02, Patrick Ouellette wrote:
> > > > Is there a way to have Linux start up (boot) in text mode for TTY1 AND
> > > have
> > > > TTY2 start up either in or simply start up X Windows automatically ?
> > >
> > >$ open startx
> > >
> > So, in theory, I could add this into my ~/.bashrc and have it run it every
> > time I log in, correct ?
> 
> I guess ~/.bash_profile would be better Patrick, 

OK

> since .bashrc is sourced every time you start a shell,
> not just a login shell.

~/.bashrc by default is not source as a personal file if shell is
interactive.
~/.bashrc            is not source as a personal file if shell is login.
It is the a common practice to have ~/.bash_profile to source
the personal ~/.bashrc file.

if ~/.bashrc is source by ~/bashrc_profile, you must
if [ "xSHLVL = "x1" ]; then
    #what we try to do;
fi

My preference to add this fonctionnality would be to create files
xfree86.sh and xfree86.csh in /etc/profile.d directory.
Which is the common pratice to add fonctionnality to /etc/profile file
by programme setup manager such as for example tar and rpm.

> Also, you could test whether /tmp/.X0-lock exists, to see if X has 
> already been started.

You must also check for /tmp/.X1-lock and so on if you do thing like
$ startx -- :1

happy hacking



More information about the OCLUG mailing list