How to switch windows manager on-the-fly?
Solution 1
Pretty much any window manager can replace the one currently running. Normally, you use the --replace
option. Read the window manager's man page for details. You just need to determine the command name for a particular wm. Google or apropos
can help you there.
Examples:
xfwm --replace # xfce, I think
metacity --replace # default wm in Gnome 2
icewm --replace # old-school wm, my favorite back in the 1990s before modern wms
Switching wms won't have any effect on which windows are open, though it'll likely affect their placement.
By the way, even though desktop environments such as Gnome, KDE, or Xfce have a default wm that works well with the environment, window managers are actually separate and can normally be mixed and matched. Note, however, that some window managers also provide some other features, such as panels, which you won't have if you switch wms.
Edit
Determing the proper command to use: These kinds of things are really easy to determine for yourself. Just take a guess at the beginning of the name. For example, "open". Then start typing the first few letters and hit Tab. If the name isn't completed, hit Tab a second time to see a list of possible matches. Once you've found the command name, type man <command_name>
to access documentation.
If you can't find the command name that way, look at the process list through some system monitor such as htop
while the program in question is running. You'll see it there, though you might not be able to use the command in exactly the same form as it's listed, particularly if it's running through an interpreter such as Python.
Solution 2
I know it's a while ago -- but as usual, after one stops looking for it, answers pop up. So I just discovered the fusion-icon
package for Ubuntu: CompizFusionIcon is exactly for this, to switch between different window managers.
So in case somebody else is still looking for an easy and convenient solution, this is another option.
Related videos on Youtube
David Tod
Linux user since the 1990s Linux-only (MS-free zone) since 2001, Ubuntu since 2005 (05.04) Currently (2012) running: Ubuntu (8.04 / 12.04), Debian, Linux Mint Desktop Environments: Mostly LXDE; SSH on the server ;) Android user since about 2010 Phones: HTC Wildfire, Motorola Milestone 2, LG Optimus 4X Tablets: Cat Stargate II, Cat Phoenix/PC4 My SE tools: StackExchange™ MultiCollider SuperDropdown™ Fixes StackExchange Link Personalizer My Android tools: Adebar (Android DEvice Backup And Reporting) profile for Izzy on Stack Exchange, a network of free, community-driven Q&A sites http://stackexchange.com/users/flair/1540386.png?theme=hotdog
Updated on September 18, 2022Comments
-
David Tod over 1 year
I know there's a command to let compiz take over from whatever windows manager is running, using
compiz --replace &
, same for unity withunity --replace &
. What are the similar commands for other window managers (e.g. KDE4's plasma, Gnome, LXDE, XFCE)? And will this take all running application windows along? -
David Tod almost 12 yearsYes, those restrictions are clear (and further apply to widgets and the like, especially with KDE4s Plasma stuff). Main reason behind my question is to be able switching to a different WM (e.g. when following/writing some Howto) and back again without losing any open apps. Thank you for providing the Gnome WM command, especially. I was especially looking for that one and the KDE4 Plasma thingy -- is that still kwm (and thus
kwm --replace
)? -
Scott Severance almost 12 yearsAs I never use KDE, I don't know the situation these days.
-
David Tod almost 12 yearsTrouble is with Plasma I'm no longer sure which one is responsible. There runs a
kwin
(which I guess must be the right one -- it was the wm in previous versions) plusplasma-desktop
process. Not sure which one I'd have to call... Probably kwin. Well, I'll find out. Anyone running LXDE and knows whhich is its wm? I guess it'sopenbox
? -
Scott Severance almost 12 yearsA DuckDuckGo search took me to the LXDE website, which says that LXDE uses Openbox.
-
David Tod almost 12 yearsThanx, yes, I know they're using "OpenBox". My question was more regarding the name of its executable to call for a switch -- and I'm not sure whether that's
openbox --replace &
for LXDE. I'm just setting up a script handling all the alternatives, so I can just call something likeswitchwm <new_wm>
(the script also checks whether that wm is available and handles that as well). -
Scott Severance almost 12 yearsThis is easy to determine for yourself. See my edit above for more.
-
David Tod almost 12 yearsThe process list was my main source to identify the unknown. During the weekend I had a chance to test -- and unfortunately a running KDE (which is my current main-DE) cannot be replaced this way, as it uses 2 components -- so
metacity --replace &
would replacekwin
(which in this case crashes and wants to send a bug report), butplasma-desktop
keeps running. Results are quite strange. Luckily, akwin --replace &
fixed that... -
Scott Severance almost 12 yearsA few Ubuntu releases ago, I had the problem of having to toggle between Unity 3D (which had usable features) and 2D (which wasn't too usable but had an essential compatibility feature). I found that if I started the session in one, I couldn't switch to the other, but the reverse works. That suggests to me that if you log in to, say, LXDE and then launch KDE's stuff from there, it might work better for you.
-
David Tod almost 12 yearsI thought about that as well -- that's why I was looking for an easy way to switch between the DEs without logging off/on, so I could check them once in a while and, if missing something, easily switch back. A pity this doesn't seem an option with KDE. -- Thank you for your help so far, Scott! I should consider my question answered; that it didn't solve my desire is a different thing ;)