Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Using XDarwin with Apple's X11 UNIX
Okay, it took a few weeks of work, but I managed to get XDarwin to work with Apple's X11 installation. Why? Well XDarwin can run full screen (which is useful), and it also runs from >console (which is just cool). Be warned, this is NOT easy, since it is extremely hard to get the XDarwinStartup and XDarwin server files without installing all of XFree86 (which Apple's X11 already provided).

[robg adds: I'm not even going to claim that I'm thinking about trying this one -- you're on your own from here on out. If you do try, please post a comment regarding the outcome of your experiment...]

  1. Install, /usr -> X11R6 -> bin -> XDarwin, and /usr -> X11R6 -> bin -> XDarwinStartup. This is the most difficult part, and may require manually extracting them from binary installers. Not fun at all, and I encourage the XDarwin group to create an installer to automate this. I'd create an install package for this myself, but I doubt it's legal.

  2. Create a symbolic link from /usr -> X11R6 -> bin -> XDarwinQuartz to -> Contents -> MacOS -> XDarwin.

  3. Copy /usr -> X11R6 -> bin -> startx to /usr -> X11R6 -> bin -> StartXDarwin

  4. Using a text editor, open StartXDarwin and change:
  5. Add the following lines to .tcshrc (may need to be modified for other shells):
    # Set the display variable - critical for running from >console mode
    if (! $?DISPLAY) setenv DISPLAY :0.0
    # Create some optional aliases to make it a bit easier to start XDarwin
    alias StartXDarwin StartXDarwin -- -fakebuttons
    alias StartXDarwinQuartz StartXDarwin -- -fakebuttons -quartz
  6. Open the terminal and run the command rehash; this will force the shell to rebuild its list of available commands.

  7. Create a ~/.xinitrc similar to the following - this will allow you to access fink-installed programs without the full path (if you need it), and will allow you to select different programs or and window managers based on what X11 environment you're using.
    # set up the fink path
    if [ -f /sw/bin/ ]; then source /sw/bin/; fi
    # set up the X11 paths
    # merge in defaults and keymaps
    if [ -f $sysresources ]; then xrdb -merge $sysresources; fi
    if [ -f $sysmodmap ]; then xmodmap $sysmodmap; fi
    if [ -f $userresources ]; then xrdb -merge $userresources; fi
    if [ -f $usermodmap ]; then xmodmap $usermodmap; fi
    # correct for locale problems
    unset LANG
    # Start the proper window manager and programs
    # Find out if X11 is running at all
    x11pid=$(cat /tmp/.X0-lock)
    if [ $x11pid -ne 0 ] ; then
      # Determine if "XDarwin" is running
      isXDarwin="`ps -x -o command | grep XDarwin | grep -v grep | wc -l`"
      if [ $isXDarwin -ne 0 ] ; then
        twm &
        xterm -geometry 120x54+10+10
      # Determine if "" is running
      isApple="`ps -x -o command | grep | grep -v grep | wc -l`"
      if [ $isApple -ne 0 ] ; then
        quartz-wm &
        xterm -geometry 120x54+10+30 -fa Monaco -fs 10
That's it!
  • Currently 2.80 / 5
  You rated: 5 / 5 (5 votes cast)

Using XDarwin with Apple's X11 | 11 comments | Create New Account
Click here to return to the 'Using XDarwin with Apple's X11' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Using XDarwin with Apple's X11
Authored by: VEGx on Mar 03, '03 11:54:54AM

Nice, I'll try it out later. Thanks a lot! Some of us have gone half crazy trying to figure this out :)

[ Reply to This | # ]
Using XDarwin with Apple's X11
Authored by: VEGx on Mar 03, '03 01:25:34PM

Failed to connect to the HID System as the window server!

Fatal server error:
Quit the Mac OS X window server or use the -quartz option.

Quitting XDarwin...
giving up.
xinit: Connection refused (errno 61): unable to connect to X server
xinit: No such process (errno 3): Server error.

[ Reply to This | # ]
Using XDarwin with Apple's X11
Authored by: diamondsw on Mar 05, '03 02:01:09AM

It looks like you were trying to launch XDarwin while Quartz was running (i.e., you were logged into the GUI). When logged into the GUI, just launching is easiest, but if you want to use the Terminal, use StartXDarwinQuartz.

[ Reply to This | # ]
Using XDarwin with Apple's X11
Authored by: VEGx on Mar 03, '03 01:57:48PM

OK, kind of a got it working, but I had to change some things.
Firstly, you need to add the "source /sw/bin/" to the `.tcshrc' file or you won't find the `xinit' program and it just will not start at all.

Did it, XDarwin finally started.

Next, started up at >console.
Problems. Many. First of all, can't use `mplayer'.
Secondly, when I finally typed `exit' it just hung, and hung... untill I had to press the power button.

Anyone else?

[ Reply to This | # ]
Using XDarwin with Apple's X11
Authored by: JeoX3 on Mar 03, '03 10:10:12PM

When I quit my gnome-session in a >console login, the screen went blue with the little spinning spokes. If this happens, try typing "exit" again and then pressing return. I think this was detailed somewhere in some documentation, but I'm too lazy to figure out where. The terminal is still accepting input at the blue screen and so typing exit brings the login screen back.

-- "(Insert enlightening or amusing signature here)" --

[ Reply to This | # ]
Using XDarwin with Apple's X11
Authored by: diamondsw on Mar 05, '03 02:05:16AM

Not sure why you'd need to add a "source" command to your .tcshrc file to start xinit. The source command is only to allow fink binaries to be found, and xinit isn't installed over there. Well, whatever works. :)

As for mplayer, I haven't run it, so I don't know. At this point, I was happy to just get the window server up and running. Alas, my boot partition is too small to install much else without risking disk corruption.

[ Reply to This | # ]
CTRL-D May Resolve Issue
Authored by: dontlikehippies on Oct 12, '03 04:03:00AM
I found this tip at the very bottom of the XonX FAQ:
My computer crashes when exiting X in console mode. What now?
When exiting X after starting from the console, your computer may look as if it is locked up. When this condition occurs, the mouse is unresponsive, the spinning rainbow cursor will not go away, and you will not see the login window. Fortunately, your computer isn't really locked up, and you can get to the login window and clear the condition by typing CTRL-D or 'exit' or 'logout'. This condition occurs because the terminal session running in console mode doesn't redraw the screen when XDarwin exits. Typing one of the alternatives above exits that terminal session and brings you back to the login window where you can start up another one.

Link to original

[ Reply to This | # ]
Using XDarwin with Apple's X11
Authored by: adashiel on Mar 03, '03 03:09:42PM
If you installed XDarwin prior to Apple's X11, you should already have XDarwin and XDarwinStartup in /usr/X11/bin/. At least I did. You'll probably have the XDarwinQuartz symlink, too. Since these were pretty old, though, I decided to download the newer binaries from the snapshot. The required files are contained in Xxserv.tgz and Xquartz.tgz. I had to delete my .Xauthority file first before I could get it to work (not sure why), but otherwise it co-exists happily with Apple's X11. I haven't tried it from >console yet, but it works well in Quartz fullscreen and rootless.

[ Reply to This | # ]
Using XDarwin with Apple's X11
Authored by: VEGx on Mar 03, '03 03:21:39PM

My ~/.Xauthority was an empty file... so I doubt it caused any trouble. It look slike VLC and `mplayer' don't work... that's a shame.

And I'm slightly reluctant to go >console again since the last time it got messy. Otherwise things seem to work.

Oh, `mplayer' doesn't work on fullscreen mode regardless if you are in a normal login or >console.

[ Reply to This | # ]
Okay, so maybe not
Authored by: adashiel on Mar 03, '03 10:45:59PM

I couldn't get XDarwin running from the console using the snapshot. I tore out the Apple X11 stuff, recompiled xfree86 (using Fink), then reinstalled Apple X11. It wasn't elegant, but everything works now.

[ Reply to This | # ]
This no longer works in 10.2.8
Authored by: englabenny on Oct 11, '03 12:52:12PM

It doesn't work anymore. Anybody who has a fix?

I get:
AUDIT: Sat Oct 11 18:51:49 2003: 19092 XDarwin: client 1 rejected from local host
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

[ Reply to This | # ]