# choose wm with xdm



## nORKy (Sep 16, 2009)

How can I add a box message to change the windows manager on xdm ?

With xmessage and play with symbolic link to many .xsession ?

Thanks you


----------



## graudeejs (Sep 16, 2009)

Impossible as far as I know


----------



## fonz (Sep 16, 2009)

nORKy said:
			
		

> How can I add a box message to change the windows manager on xdm ?
> 
> With xmessage and play with symbolic link to many .xsession ?
> 
> Thanks you



You're on the right track. As far as I know killasmurf is right and there's no clear-cut way to do this elegantly in XDM itself, but it is definitely possible to rig something up.

One important question: do you want to offer this choice to just one user or to all users? The first case is easy, the latter is a bit trickier but still not impossible.

Regards,

Alphons


----------



## nORKy (Sep 16, 2009)

one user


----------



## fonz (Sep 16, 2009)

In that case I suggest you use a .xsession that looks something like this (partly pseudo code, but you appear to be proficient enough to figure the rest out for yourself):

```
#!/bin/sh

# Ask which WM to use

# (possibly do something with the background here to make it look a little better)
xmessage -buttons "kde:1,fvwm2:2,blackbox:3,enlightenment:4" "Please choose your window manager..."
# (possibly use -geometry to neatly align the window)
CHOICE=$?

case ${CHOICE} in
  1) WM=/path/to/kde
     WM_ARGS="--options bla bla config file this or that"
     ;;
  2) WM=/path/to/fvwm2
     WM_ARGS="--fvwm2 arguments"
     ;;
  3) WM=/path/to/blackbox
     WM_ARGS="you get the idea"
     ;;
  4) WM=/path/to/enlightenment
     WM_ARGS="whatever"
     ;;
esac

# Start WM and remember its PID

${WM} ${WM_ARGS} &
WAIT_PID=$!

# Do additional stuff if you like

xterm&
xv -root -quit -max ~/wallpaper.jpg&

# Wait for the WM to die

wait ${WAIT_PID}

exit 0
```

If you have any questions feel free to ask, but I think you'll get the idea.

Hope this helps,

Alphons


----------



## nORKy (Sep 17, 2009)

I understand, thanks you. I'll try it


----------

