An xinitrc file for Apple's X11 and XDarwin

Jan 20, '03 09:22:42AM

Contributed by: Anonymous

If you have both Apple's X11 and XDarwin installed, this chunk of code should be of use. It will choose the correct window manager (quartz-wm for X11 or twm for XDarwin) when you start X.

Make sure your .xinitrc shell uses sh or bash if you choose to use this code snippet. Replace your window manager invocation in .xinitrc with:

pid=$(cat /tmp/.X0-lock)
if [ $pid -ne 0 ] ; then
isxdarwin=$(ps -p $pid | grep XDarwin)
isxdarwin=$?
if [ $isxdarwin -eq 0 ] ; then
# we've got XDarwin ...
twm &
#/sw/bin/blackbox &
else
# We've probably got native X11
/usr/X11R6/bin/quartz-wm &
fi
fi
[Editor's note: I have not tested this myself...]

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030120062242124