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?

1 Answer 1

6

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.

6
  • +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, 2016 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?). Jul 26, 2016 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, 2016 at 8:07
  • Yup, that matches my memories too — right-clicking on the desktop in FVWM... Jul 26, 2016 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, 2016 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.