Mailing List Archive

Support open source code!


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

Re: managing multiple window managers



Stephen J Turnbull <turnbull@example.com> writes in tlug@example.com:

>>>>>> "Hector" == Hector Akamine <akamine@example.com> writes:
Hector> 1) Is there a way to make .xinitrc able to work with both? 
Hector> (for example that it recognizes the computer in which I am
Hector> running startx, or if it's possible to pass any parameter
Hector> to tell it which window manager I want to start). How
Hector> should the format of .xinitrc would be like?

> You shouldn't need a ~/.xinitrc.

Yes, but some distros provide one for you by default.


This is Unix so there are many ways of doing it.  The best answer is a
matter of taste.  Something like the following code snippet should do
it:

case `hostname | cut -d. -f1` in
host1) WMANAGER=/usr/X11R6/bin/wmaker ;;
host2) WMANAGER=/usr/bin/gnome-session ;;
 # ...
esac

 ...

#START_WINDOWMANAGER
eval exec $WMANAGER
#END_WINDOWMANAGER

If you are always running X manually, ie. by typing `startx' you can
put parameters in your .zshenv, or whatever.  If you are sometimes
running X via XDM, then you will need to do it in .xinitrc.  I don't
recommend changing system files as you will tend to lose any changes
when you upgrade the system.


Another possible solution is to use a Window Manager switching
program and call that instead of a Window Manager.  I used to have one
installed when I rolled my own distro.  You should be able to find it
on Freshmeat.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links