[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can kdm 'source' ~/.xinitrc ?



Nate Bargmann wrote:
> * Bill Marcum wrote:
> > phyrster wrote:
> > > My question is there anyway to make kdm use '.xinitrc' like startx does?
> > > 
> > I haven't used kdm, only xdm and gdm, but you could try '.xsession'.
> 
> kdm doesn't source ~/.xsession as near as I can tell either as xdm does.
> 
> I'd be interested in an answer to this as well.

The kdm program does run the ~/.xsession script if you have not told
it not to run it.  (It does not "source" it but runs it normally[1].)
But it only runs ~/.xsession if you pick the default session.  If you
pick KDE or Fvwm or Fluxbox or whatever then it run only that session.
In that case you have told it not to run the .xsession file.

For example if the user picks KDE then the kdm says to itself, "The
user did not pick the default.  The user specified to run KDE.  The
user must have an error in their personal configuration files or
otherwise wants to avoid them.  I will avoid running those files and
ONLY run the stock installed distribution KDE files.  That way the
user's errors will be avoided, they can log into the machine, and
avoid their own personal configuration."  If you listen very closely
to the machine I am sure you can actually hear it muttering to
itself.  :-)

If you have a ~/.xsession file then to use it you need to pick the
"default" session.

Bob

[1] It actually does this in the code.  If it is executable then run
it.  If it is not executable then run sh, the POSIX shell, upon it.

        USERXSESSION=$HOME/.xsession
        ...
        if [ -x "$STARTUPFILE" ]; then
          STARTUP="$STARTUPFILE"
        else
          STARTUP="sh $STARTUPFILE"
        fi

This means that you really want the file to be executable.

  chmod a+x ~/.xsession

And that you should always start the line with an interpreter and it
is beneficial to make that interpreter a login shell.  Then it will
source the login script .bash_profile in this case.

  #!/bin/bash --login

If the file is not executable then the #!/bin/bash --login line in the
file it will not have any effects because when read by sh that # is a
comment and the line is ignored by it.

Attachment: signature.asc
Description: Digital signature


Reply to: