From: Cameron Simpson To: linux@research.canon.com.au Cc: Bcc: Subject: Re: X init file? Reply-To: cs@zip.com.au In-Reply-To: <20000214235853.643631B64F@elph.research.canon.com.au>; from duncanp@research.canon.com.au on Tue, Feb 15, 2000 at 10:58:51AM +1100 On Tue, Feb 15, 2000 at 10:58:51AM +1100, duncanp@research.canon.com.au wrote: | On 15 Feb, luke@research.canon.com.au wrote: | > On 15 Feb, Mike Lawther wrote: | >> i was wondering if anyone knew what file i would have to modify on my | >> linux box here to change what window manager i get. i want to run | >> enlightenment, but not gnome (essentially just exec | >> /usr/bin/enlightenment). [...] | xinitrc looks for .Xclients in your home dir, then defaults to the one | in /etc/X11/xinit - this looks for a file called .wm_style in your home | directory, which specifies the window manager - it doesn't know about | enlightenment, but if you want to be consistent with the way things are | done by default, you could make a copy of .Xclients in your home | directory, and make it aware of enlightenment. | | Then again, maybe the above stuff does not apply when logging in with | *dm - i usually crank up X from the command line. This a bit linux-specific. For a more general solution, you want some more lore. There are 3 environments I have to run X under: - from the command line (with xinit - some prefer startx) - from CDE (the Solaris GUI login) - from XDM (the "X" GUI login, which GDM models) These are subtley different, listen to different control files, and run things from a different state of loggedinness. Yet we want the same desktop no matter which we log in from. What to do? Here's what I do: From the command line, startx or xinit will run your .xinitrc session (startx is a wrapper for xinit with a "pretty" fallback for the user with no .xinitrc). When you do this, /etc/profile and your .profile have been run. So... you need only add any extra X11-related vars (usually none), run your desired tools, and then exec a window manager (so quitting the wm quits your session). So you want a .xinitrc looking like this: #!/bin/sh ( tool1 & tool2 & ... ) exec enlightenment Notes: the subshell is so the tools aren't children of the wm, and being orphaned grandchildren get inherited by init, leaving no zombies if you close one of the tools. Also, see that we DO NOT exec enlightenment (or any tool) with a full path because our shell env is already set up. Also also, many users may wish to split the "( tools... )" bit off into a .Xclients file. Your call - I can't see the point myself. Now we want to fold the XDM stuff into this scheme. XDM runs the script .xsession. At this point your normal /etc/profile and ~/.profile HAVE NOT been run, but otherwise we want things to look like our xinit/startx session, so our .xsession file says: #!/bin/sh . /etc/profile . $HOME/.profile . $HOME/.xinitrc Easy, eh? All that remains is CDE. Normally it runs loads of goop, but before doing any of it it sources a special env setup file called .dtprofile. This can be used to usurp the whole shebang, diverting it into a normal XDM style startup: #!/bin/sh exec $HOME/.xsession Note that exec; unlike the .xsession, which is used in place of the "default" session by XDM, .dtprofile is source as part of the CDE startup script. So we actually abort that startup script with the exec and segue off into our own .xsession. So those three files are all you need. Make sense? -- Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/ Sure, there's on born every minute, but what good is that? That's a lousy 525,600 new suckers a year. - Richard Mitchell