changing window managers & .Xclients 

Newsgroups: comp.os.linux.misc
>In order to change window managers, before I run startX, I edit my
>.Xclients file and uncomment the one I want. It looks like this:
>Is this the *right* way to do it?

It depends. When you do that, various desktop switchers lose control. Since I never used a desktop switcher, this was of no consequence. The redhat one (gnome?) uses an entry in .wmstyle (.wm_style?) to tell .Xclients what the "preferred window manager" is.

xinitrc is useful if you do not use a graphical login screen (via. xdm or gdm or kdm or whatever); it's only invoked if you "startx". .Xclients takes its place for a graphical login.

Dave Brown

changing window managers & .Xclients 

> I type 'startx' to go into X.

startx calls xinit; xinit calls $HOME/.xinitrc, if not found, calls /etc/X11/xinit/xinitrc; xinitrc calls $HOME/.Xclients, if not found, calls /etc/X11/xinit/Xclients; Xclients looks for your window-manager setting.

If you're using a display manager, you intercept the above sequence at the .Xclients/Xclients level, since the display manager starts the Xserver (otherwise the function of xinit).

So if you use "startx", and put in .xinitrc a line "startkde", that will start KDE. But if you did a graphical login, .xinitrc is not read. If you don't have an .xinitrc, then .Xclients takes over. Then you could put in .Xclients "startkde" to start KDE. That would affect both "startx" and graphical login.

I do believe that the contents of the default files, xinitrc and Xclients are probably distribution-dependent.

Dave Brown