Subject: Re: xdm - selecting WM on login
To: Wojciech Puchar <wojtek@tensor.3miasto.net>
From: Luke Mewburn <lukem@netbsd.org>
List: netbsd-users
Date: 03/25/2003 04:11:51
On Mon, Mar 24, 2003 at 05:22:11PM +0100, Wojciech Puchar wrote:
  | is it possible for xdm to ask for window manager?

the traditional way one solves this problem in an xdm environment
is to modify your ~/.xsession.  (that's worked for me for over a decade)



  | in /usr/X11R6/lib/X11/xdm/Xsession i found things like this showing that
  | windows manager option can be sent as first parameter.
  | 
  | 
  | 
  | if [ -s "$startup" ]; then
  |         if [ -x "$startup" ]; then
  |                 exec "$startup"
  |         else
  |                 exec /bin/sh "$startup"
  |         fi
  | else

if $startup (~/.xsession ?) exists, use that


  |         if [ -r "$resources" ]; then
  |                 xrdb -load "$resources"
  |         fi
  | 
  |         case $# in
  |         1)
  |                 case $1 in
  |                 kde)
  |                         exec $SHELL -c startkde
  |                         ;;
  |                 esac
  |         esac
  |         exec xsm
  | fi

otherwise, source $resources, and if $1 is "kde", use that in
preference to xsm.

the "kde" argument code comes from something like the following in
/usr/X11R6/lib/X11/xdm/Xresources:

	xlogin*login.translations: #override \
		<Key>F1:	set-session-argument(kde)finish-field()\n\
		<Key>F2:	set-session-argument(twm)finish-field()\n\
		<Key>Return:	set-session-argument() finish-field()

the argument to "set-session-argument()" is passed as $1 to .../xdm/Xsession.


xdm(1) explains more.