Skip to main content
Welcome guest. | Register | Login | Post

launching a different window manager in a window

If you ever tried a window manager that doesn't use overlapping windows, you will have found that some programs create too many windows to work well with it. You can let these programs use an X server that displays in a window of your first X server.

The easiest way to do that is as follows:

Xnest -ac :1 &
export DISPLAY=:1
your-other-windowmanager &
program-you-want-to-run &

(If you already have more than one X server running, try :2 , :3 , and so on)

This has one downside: anyone can now display things in that window, using export DISPLAY=yourIPaddress:1. If your X and/or firewall configuration is good, the damage is limited to other users on your computer displaying things in your window, which is okay if the only person with an account on your computer is you. If not, we shouldn't disable access control (-ac option), but then we need to make sure the access control doesn't lock us out either. I use the following scripts:

launchxnest:

#!/bin/sh

startx /path/to/session -- /path/to/myX $@

session:

#!/bin/sh

your-other-windowmanager &
program-you-want-to-run

myX:

#!/bin/sh

Xnest -geometry 1000x700 $@

The whole thing is started with launchxnest :1 .

This way, startx gives Xnest, your windowmanager and your program all the information they need to connect to each other without allowing others to do the same.

There are instructions on the web that use mcookie and xauth directly instead of through startx, but those don't work for me. YMMV.