#/usr/lib/X11/system.xinitrc

# This is the default .xinitrc for MacMach with a small screen.

# set a black screen background
xsetroot -solid black

# a clock is nice...
xclock -fg white -bg black -hd white -hl white -bd black -geometry =60x60-0+24 &

# The console window is a small xterm.  The infinite loop makes sure that
# there is always a console.  Using su allows the user to have quick access
# to a root shell.  If the password is not given, it will still act as a
# console display.  The console activity is also written to a log file.
(
  rm -f /tmp/console.log
  while true; do
    xterm -C -lf /tmp/console.log -l -sb -sl 100 -fn 6x13 -n Console -T root@`hostname` -geometry =80x5+0-0 -e su
  done
) &

# The user's xterm, this will fit on a small (342 X 512) mac screen.
# Wait a few seconds for the window manager to come up.
(
  sleep 10
  exec xterm -sb -sl 100 -fn 6x13 -n xterm[$$] -T $USER@`hostname`[$$] -geometry =80x24+0+0
) &

# Try to start up a window manager...
# Note that the window manager is exec'ed so that its exit will
# trigger the termination of the X server.
[ -f /usr/bin/X11/gwm -a -f .gwmrc.gwm ] && exec /usr/bin/X11/gwm
[ -f /usr/bin/X11/twm -a -f .twmrc ] && exec /usr/bin/X11/twm
[ -f /usr/bin/X11/uwm ] && exec /usr/bin/X11/uwm

# Failed if no window manager.
echo "/usr/lib/X11/system.xinitrc: cannot find a window manager"
echo "Copy one of the default rc files from /usr/lib/X11 to your"
echo "home directory to chose a window manager."
echo "For example, to use the \"twm\" window manager do:"
echo "  cp /usr/lib/X11/twm/system.twmrc \$HOME/.twmrc"
sleep 15
exit 1
