5

Years ago (around 2000) I saw a guy at a Linux meeting do an amazing X-windows trick which I've never seen repeated since.

While he was logged into his default window manager (let's say Gnome), he opened some programs (e.g. xterm, xclock, xeyes), and then from the xterm window he issued some commands to stop Gnome but leave all the open windows in place on the desktop (the desktop then showed the standard X course-gray background). He then typed (still in xterm) the commands to start a different window manager (let's say KDE) and, lo and behold, the whole new window manager picked up all the open windows, rendered the background, taskbar, and window buttons with the new manager's desktop theme.

I don't know if this was switching from Gnome to KDE or other window managers but it showed the independence of the window manager and the x server.

What are the commands to safely unload and reload a window manager in this fashion? Can this still be done with today's window managers?

5

Switching window managers is supported by all X window managers; typically it involves running them with a --replace argument, so they replace the currently-running window manager:

metacity --replace &

Depending on how your X session started, you could kill the current window manager and start a new one, but for that to work, you need to be sure that killing the window manager won't stop your X session, and you also need to be sure that the terminal you're using (xterm or whatever) will still have the focus after the window manager is gone.

  • +1. and it wasn't uncommon for window managers to be configured with menus that allowed easy switching to other window managers. I know debian used to (and maybe still does for WMs that are just WMs rather than DEs) generate such menus for most if not all WMs. – cas Jul 25 '16 at 23:31
  • @cas I'd forgotten about that, but yes indeed, Debian had a menu for all the installed WMs (was it just a section of the main Debian menu?). – Stephen Kitt Jul 26 '16 at 7:15
  • can't remember exactly. submenu off the main menu i think. and also in the right-click-on-desktop menu. – cas Jul 26 '16 at 8:07
  • Yup, that matches my memories too — right-clicking on the desktop in FVWM... – Stephen Kitt Jul 26 '16 at 8:21
  • Now that I am beginning to understand the difference between a window manager and a desktop environment, I am no longer sure what it was that I saw all those years ago. It could have been that he just switched window managers. In that case my question is answered. But out of curiosity, is there also a way to live-swap desktop environments (like the example in my question, switching from KDE to Gnome)? – captcha Aug 3 '16 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.