PDA

View Full Version : Blackbox immediate switch to other wmanagers


macmath
09-03-2003, 02:34 PM
Hi.

I have been working with Blackbox (rootless) lately instead of the quarz-wm. I also have WindowMaker, and Quartz-wm ready to go (upon switching out .xinitrc files). I have read threads about switching them out so that one can switch between them easily, but my question is somewhat different.

Blackbox has the option in its menu to start another windowmanager. If I ask it to start Windowmaker, I find I will suddenly be using Windowmaker, all without quitting and restarting the x11 environment. Similarly, I can ask Blackbox to switch to Quarz-wm and it will do so immediately without having to quit and restart x11. Of course, then I can't get back to Blackbox without quitting and restarting. I know that it is not just emulating quartz, because, the bbpager (although still running) is inoperable and all my windows (formerly spread over several workspaces) are all in my current window. If Blackbox were still running and giving me quartz-style windows, then my old workspaces should still exist.

How does Blackbox do that, and can I make WindowMaker and Quartz-wm do the same thing?

stetner
09-03-2003, 05:39 PM
macmath, any window manager should be able to what black box does (that is not to say they will). The X windows system does not *have* to have a window manager running (it is just a lot more useful with one :) ).

You cannot have 2 window managers running at the same time though. So what BB probably does is to 'exec' the new window manager over itself. Therefore it will have quit before the new manager starts.

So, it is up to the window manager to give you access to an 'exec over top of me' type command, and I am not sure if those other window managers do, scanning their man pages for that option is the best bet.

The other option is to kill off the manager externally and then fire up the new window manager (from a shell script or something)

macmath
09-03-2003, 09:28 PM
Thanks. That put me on the track I needed to follow. Something like this:

#!/bin/sh
qz=`ps wwax | egrep -i "[q]uartz-wm" | awk '{ print $1 }'`
if [ $qz ]
then
kill -9 $qz
fi
/sw/bin/blackbox


It works anyway. I can't take credit for it. I knew I had read somewhere (http://forums.macosxhints.com/showthread.php?s=&threadid=11755) on these forums about grabbing a pid and killing a process without knowing the pid personally.