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

Re: startx + ~/.xsession and no ~/.xinitrc, results in reduced functionality (xfce4, sid)



Charlie wrote:
> Bob Proulx sent:
> > If you are using startx then yes you should use xinitrc.
>
> I use startx and have an .xsessionrc file that loads all manner of
> things for me at start up. [gkrelm,terminals,kalarm etc.,] It works for
> me, copied from FVWM. Now using Xfce4 as FVWM on AMD64 isn't all that
> nice, and I can't configure it to make it nice again. My problem and
> no time to work with it at the moment.

I am not quite following.  You say you have startx and a .xsessionrc
file.  And this is working for you?  Sounds like it is.  In which case
I don't know how.  But then you say that you can't configure it so I
am not sure.

> I didn't realise that xinitrc is the way to go?

Not quite.  There are many layers and many choices available.

With startx the documented interface is ~/.xinitrc or ~/.xsessionrc or
~/.xsession.  The man page only documents the ~/.xinitrc file.

  man startx

But since startx chains off to /etc/X11/xinit/xinitrc which chains off
to /etc/X11/Xsession then all of the customization of Xsession is
also available through the daisy chain.

  man Xsession

The man page for Xsession documents ~/.xsessionrc and ~/.xsession.  It
says that ~/.xsessionrc is only for setting variables and the
~/.xsession is for executing commands.  (But in reality this is a grey
area.)

In order to get the entire list of possibilities you would need to
connect across from one man page to the next as one references the
next one in the next layer.  Or you could keep it simple and use the
one that the command documents first.  But the reality is that one
chains to the other and so both are possible.

> I'm happy with what happens when I boot my system - same as when I
> used .xsessionrc with FVWM. But will look into it and read a bit when
> time permits. I could be doing the wrong thing entirely.

The choice of customization file is not an attribute of the window
manager.  It isn't tied to fvwm nor xfce.  The choice of customization
file is tied to how X is started.  After X is started then any of the
window managers or desktop sessions may be started after that point.

Let me try to explain this in a slightly different way.

  1.1. xinit command line
     Uses ~/.xinitrc
  1.2. startx command line (wrapper around xinit for reasonable defaults)
     Uses ~/.xinitrc if exists
       Otherwise uses /etc/X11/xinit/xinitrc
         /etc/X11/xinit/xinitrc sources /etc/X11/Xsession
           Redirects output to .xsession-errors
             sources ~/.xsessionrc if exists
             executes ~/.xsession if executable, sources if not, if exists
  2.1 xdm graphical login manager (or gdm, or kdm, or lightdm, or other)
     Runs /etc/X11/Xsession
        Redirects output to .xsession-errors
          sources ~/.xsessionrc if exists
          executes ~/.xsession if executable, sources if not, if exists

These are all scripts so very easy to trace through.  I highly
recommend that if anyone is still confused that they simply read
through the scripts and see for themselves what they do.  Then there
is nothing between the scripts and your understanding of them.

The /usr/bin/startx script is a relatively small and simple script.
I would not call it beautiful.  But it is easy reading.  I suggest
that if there anyone is wondering what is going on with startx that it
is easier to browser the script and look.  Then all doubt can be
removed.

  less /usr/bin/startx

Or they could trace through the running of the script when they start
it.

  sh -x /usr/bin/startx 2>&1 | tee startx.out

That will show all of the commands run by the script and will save
them to the file.  Then browsing the file should reveal all that is
happening in the script.

Being a script is an advantage at times like this because it makes it
simple to see what it is doing.  How did I know it was a script?  It
has been one forever.  And I always look.  Because may commands are
scripts.  If they then I browse through them to see what is in them.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: