You are not logged in.
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
Offline
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
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
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
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
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
choosewm offers a similar option. Package in AUR.
Offline
I have a similar question.
Would the same solution be applied for Desktop Environments?
thanks.
Offline
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
Last edited by Square (2010-07-13 21:16:29)
Offline
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
Offline