You are not logged in.

#1 2010-07-12 12:16:45

schen
Member
Registered: 2009-06-06
Posts: 468

startx and different WMs [solved]

Hi everyone,

I use startx to start X, but I use three different WMs, compiz stand-alone, dwm, and catwm. Is there an easy way to switch window managers?

Last edited by schen (2010-07-15 09:38:28)

Offline

#2 2010-07-12 12:18:51

KimTjik
Member
From: Sweden
Registered: 2007-08-22
Posts: 715

Re: startx and different WMs [solved]

Offline

#3 2010-07-12 12:20:07

ablepharus
Member
From: Berlin
Registered: 2010-05-23
Posts: 129

Re: startx and different WMs [solved]

Do you want to switch them while you are working? Or do you want to start one of the three? 

If you want to change, many wm have a '--replace' option and you could also start a new x server with startx -- :1

Offline

#4 2010-07-12 13:39:29

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: startx and different WMs [solved]

You could also create multiple .xinitrc files like .xinitrc, .xinitrc1 etc and put in key bindings in xbindkeys to switch wms without having to log off.

That way you dont have to replace the current wm, simply change over to the other one and switch back if you need to


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2010-07-12 14:07:26

pseup
Member
Registered: 2008-06-06
Posts: 103

Re: startx and different WMs [solved]

If you just want to select a WM as you start X, then you can also have a case statement in your .xinitrc. eg

# Stuff to execute no matter the wm here

case $1 in
catwm)
  # catwm specific stuff &
  exec ck-launch-session catwm
  ;;
compiz)
  # compiz specific stuff &
  exec ck-launch-session compiz-manager # or whatever its called
  ;;
dwm)
  # dwm specific stuff &
  exec ck-launch-session dwm
  ;;
*)
  # a default wm in here
  ;;
esac

Then instead of using `startx` you can fire up X with `xinit catwm`, `xinit compiz`, `xinit dwm` or just `xinit` for the default.

Last edited by pseup (2010-07-12 14:14:56)

Offline

#6 2010-07-12 14:16:05

knopwob
Member
From: Hannover, Germany
Registered: 2010-01-30
Posts: 239
Website

Re: startx and different WMs [solved]

here's my way to do this:

if got this in my ~/bin (called myx)

#!/bin/bash - 

display=$1
if [ "$display" == "" ]; then
    display=0;
fi

select wm in dwm catwm musca; do #change this to your windowmanagers
   startx ~/.xinitrc $wm -- ":$display"
   break
done

and my .xinitrc looks like this:

#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

xmodmap /home/knopwob/.Xmodmap
feh --bg-scale /home/knopwob/portal.jpg
xcompmgr &

exec $1

so just use myx to start the wm you selected afterwards on display 0
or myx 1 to start it on display 1 etc.

Last edited by knopwob (2010-07-12 14:18:43)

Offline

#7 2010-07-13 16:16:07

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: startx and different WMs [solved]

choosewm offers a similar option. Package in AUR.

Offline

#8 2010-07-13 20:57:11

mh3rn4nd3z3
Member
From: USA
Registered: 2010-07-02
Posts: 50

Re: startx and different WMs [solved]

I have a similar question.
Would the same solution be applied for Desktop Environments?

thanks.

Offline

#9 2010-07-13 21:12:46

Square
Member
Registered: 2008-06-11
Posts: 435

Re: startx and different WMs [solved]

I use an environmental variable like so:

feh --bg-scale /path/to/wallpaper &
xmodmap ~/.Xmodmap &

if [[ $WM == "xmonad" ]]; then

 xsetroot -cursor_name left_ptr &
 exec xmonad

elif [[ $WM == "ion3" ]]; then

 exec ion3

else

 WM=compiz & exec /path/to/fusion.sh

fi

Then, you just start x with a variable prepended, like

WM=xmonad startx

I love this method smile

Last edited by Square (2010-07-13 21:16:29)


 

Offline

#10 2010-07-15 09:37:50

schen
Member
Registered: 2009-06-06
Posts: 468

Re: startx and different WMs [solved]

pseup wrote:

If you just want to select a WM as you start X, then you can also have a case statement in your .xinitrc. eg

# Stuff to execute no matter the wm here

case $1 in
catwm)
  # catwm specific stuff &
  exec ck-launch-session catwm
  ;;
compiz)
  # compiz specific stuff &
  exec ck-launch-session compiz-manager # or whatever its called
  ;;
dwm)
  # dwm specific stuff &
  exec ck-launch-session dwm
  ;;
*)
  # a default wm in here
  ;;
esac

Then instead of using `startx` you can fire up X with `xinit catwm`, `xinit compiz`, `xinit dwm` or just `xinit` for the default.

Thanks! This seemed the simplest, so I used it.

Offline

#11 2010-07-17 00:41:31

valium97582
Member
Registered: 2010-06-19
Posts: 126

Re: startx and different WMs [solved]

Damn, just use CDM!


I'm also known as zmv on IRC.

Offline

Board footer

Powered by FluxBB