macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

Rootless X Server on Mac OS X
Pages: 1, 2

It installed over my old copy of XFree86 4.1.0 without any problems. Aside from taking a long time, the process was very painless.



After it installed, I thought I would click the XDarwin icon to see if anything different happened. I was greeted with a menu that asked if I wanted to start XFree86 in full-screen mode or rootless.

Screen shot.

I clicked on Rootless and it proceeded to load X right on top of all my windows. I hadn't configured anything yet, so it loaded twm as the window manager. The default configuration loads three xterm windows and an xclock. It appears the default settings are optimized to work with a screen resolution of 1024 x 768 or higher. Because my iBook is only capable of 800 x 600, my desktop looked like the image below.

Screenshot.

The first thing I noticed was that the top menu bar was covering the uppermost part of the window preventing me from grabbing and moving it. The window was also cut off at the bottom so I couldn't resize it. By pressing command+option+a, I was able to toggle the menu bar on and off. The bottom dock also disappeared at the same time. That let me get to my window and move it, but the entire process was somewhat annoying.

I then created a .xinitrc file in my home directory.

vi ~/.xinitrc

xterm &
xterm & 
twm

I added the commands to start the window manager, twm, plus a couple of xterm windows.

When I restarted X this time, it didn't appear as though anything happened. However, when I pressed command+option+a, it revealed that the xterms had started minimized and were hidden under the menu bar.

You can pass parameters to xterm that tell it how to look when it starts. So I changed the xterm line to read:

xterm -geometry 80x20+94-50 &

Now I get a much more reasonable sized window when I start X.

The next thing I changed was the XDarwin preferences. The preferences allow you to set the startup default to rootless, change the toggle key sequence, and tweak a few other knobs. I set mine to start rootless by default, without being prompted every time.

Here are a few other handy tips I picked up.

To quit X, just select it from the menu item. You can also click and hold on the dock icon and select quit from there.

If you highlight something in an X window, it immediately becomes available to the buffer so that you can paste it into an Aqua window using command+v. If you want to paste in an X window, use command+click.

If you close all your xterm windows, you can start one from a terminal window. Actually, you can start any X program from a terminal window. However, it won't be able to open the display unless you set the display environment variable or implicitly tell it which display to "connect to." The display number is 0 (zero) and is configurable in the XDarwin preferences. To start an xterm from an Aqua terminal try this:

xterm -geometry 80x20+94-50 -display :0.0

That should be enough to get you going with rootless X on X. I really dislike the default window manager and will be experimenting with others. If you know of a good window manager for rootless X on X, let me know and I will review a few of them in my next article.

After writing this article, I found that the X on X project has released a binary patch for XFree86 4.1.0 that will allow a rootless X server. The patch is based on a CVS checkout from about the same time I was compiling my copy, so you should get the same results.

Chris Coleman is the Open Source Editor for the O'Reilly Network and is actively involved with community projects such as OpenPackages.org and Daemon News.


Read more Mac Dev News Roundup columns.

Return to the Mac DevCenter.