[svlug] X Sessions

Erik Steffl erik at zasran.com
Fri Nov 14 13:23:03 PST 2014

On 11/14/2014 01:00 PM, Scott DuBois wrote:
> On 11/14/2014 12:30 PM, Erik Steffl wrote:
>>     how to start additional X server and what is started along (like a
>> window manager) depends on which distro you are using, the following
>> will likely work in most distros.
>>     Generally you have two options, startx or display manager.
>>     When using startx it usually (always?) uses ~/.xinitrc (you can also
>> refer to e.g. http://www.x.org/archive/X11R6.8.1/doc/startx.1.html or
>> for KDE specific instructions see
>> http://www.linuxfromscratch.org/blfs/view/svn/kde/config.html)
> Well, I still have a couple of questions:
> 1. I don't seem to have ~/.xinitrc which means
> 	A. Create a new one @ ~
> 	B. ln -s /etc/X11/xinit/xinitrc

   as you can see /etc/X11/xinit/xinitrc executes /etc/X11/Xsession 
which in turn executes ~/.xinitrc (if it exists). So linking 
/etc/X11/xinit/xinitrc to ~/.xinitrc would be a bit like that dragon 
that eats its tail :)

   essentially if you are happy with what startx does by default you 
don't need ~/.xinitrc. If you are not then create ~/.xinitrc and put 
whatever you want there (like start KDE or your favourite window manager 

> with option A will that file be referenced separate from the one in /etc
> when the system boots and be only utilized by CLI startx command and
> with option B what problems will this cause by editing the existing
> xinitrc with regards to KDE bootloading?

   your custom ~/.xinitrc should not interfere with anything else in the 
system, should only be used by startx.

   note that there is (could be) also ~/.xsession which is usually used 
by display managers. Sometime people link ~.xsession to ~/.xinitrc so 
that X starts the same way regardless of whether they start it from 
display manager or startx.

   check out e.g. 
http://unix.stackexchange.com/questions/47359/what-is-xsession-for for a 
pretty good discussion of X startup scripts. Note that it links to a 
book that you can read online that would make you a master of X 
administration :) Ninja even if you really really read it like you mean 
it :)


> Current xinitrc:
> roguehorse at linux:~$ cat /etc/X11/xinit/xinitrc
> #!/bin/sh
> # /etc/X11/xinit/xinitrc
> #
> # global xinitrc file, used by all X sessions started by xinit (startx)
> # invoke global X session script
> . /etc/X11/Xsession
> roguehorse at linux:~$

More information about the svlug mailing list