Solved multiple wm with twm

joplass

Active Member

Reaction score: 46
Messages: 249

Hello forum,

I usually use spectrwm. Recently after a fresh install I got to play with twm. I am unable to run both spectrwm and twm on the same box. I added exec twm in .xinitrc right below exec spetrwm. Using slim, I can pick a wm to load but choosing twm switches automatically to spectrwm. I can only load twm by commenting out spectrwm. Is there a way run twm with another wm?

I did some internet research, I did not find anything helpful.

13.0-RELEASE

Thank you,
 

jmos

Well-Known Member

Reaction score: 186
Messages: 254

X sessions are driven by (many) simple script files. Script files are parsed line by line, so just adding one window manager after another will end up in executing the second window manager when quitting the first one (and so on).

Your login manager "slim" (I don't use it) seems to give you the choice of which window manager you want, but you're wanting that within startx and/or the users session itself?

Install x11-wm/selectwm, and use selectwm as your window manager (and of course: configure it); It is a "window manager starter", with which you can select the wanted window manager after you logged in or executed startx. So selectwm goes in front of the afterwards started window managers.
 

chrbr

Aspiring Daemon

Reaction score: 356
Messages: 869

Dear joplass,
in case you use startx:

You could also create a variable as WM at login in your .profile or what applies for your shell. In your .xinit the variable can be used to start the window manager by exec $WM. To change the WM setting one could use a menu by dialog(1) or just two scripts which set WM and then run startx. Oh, I still have something:
Code:
#!/bin/sh

WM=`/usr/bin/dialog --stdout --no-tags --menu "Window Manager" 15 25 5 i3 i3 jwm jwm fvwm fvwm fvwm-themes-start fvwm-themes-start twm twm startkde4 kde4`
export WM
startx
I have not tested it right now. There are backticks in the WM= line which are difficult to recognize. The $(..) syntax should be better.
 

T-Daemon

Daemon

Reaction score: 829
Messages: 1,690

I added exec twm in .xinitrc right below exec spetrwm. Using slim, I can pick a wm to load but choosing twm switches automatically to spectrwm. I can only load twm by commenting out spectrwm. Is there a way run twm with another wm?
After a successful login with x11/slim the shell script ~/.xinitrc is executed by SLim. See /usr/local/etc/slim.conf, line 38.

From ~/.xinitrc only one desktop environment can be started. You can't start different environments. When there are set multiple environments the first one is executed, all others following ignored.

If you wish to choose at SLim's login the desktop environment remove exec spectrwm and exec twm from ~/.xinitrc and set as last line
Code:
exec $1

I did some internet research, I did not find anything helpful.
Next time searching for solutions include also searching in Forums FreeBSD. In fact start searching in Forums first then search world wide . This solution is documented multiple times.
 
OP
J

joplass

Active Member

Reaction score: 46
Messages: 249

T-Daemon,

Thanks for the advice. Just exec 1$ did the trick.
 
Top