#!/bin/sh
# default startup commands for X
#
# If you want to *add* operations to this file, you can write just the
# commands you want to add to a file called $HOME/.myXsession, and they
# will be run in *addition* to the default commands.
#
# If you logged in with F6..10 then $1 has the function key name in it.
#
# You can also copy over this whole file to your home directory, with a
# name of .Xsession. In this case Xdm will start your own copy
# of the script from your home directory, and not use this systemwide
# default at all.
#
# WARNING: This is run using /bin/sh
#
# User default version by Hannu Aronsson <haa@cs.hut.fi> and others

# Make "Enter" key generate Linefeed. This might be Sony specific. //jvh
xmodmap - << EOF
keysym Execute = Linefeed
EOF

# The console window to the top left part of the screen
#
xterm -C -g 80x5+0+0 -title "Console" -n console &

# A clock to the upper right part of the screen
#
xclock &

# Inform us about incoming mail
xbiff -geometry -110+5 &

# A large shell window to the left side of the screen
#
xterm -g 80x57+5-20 -title "Xterm" &

# Mouse settings, xset m 3 (speed) 5 (threshold) is quite fast. See
# xset(1) manual for details.
#
xset m 3 5

# If user has .myXsession, commands will be run from there also. It's
# supposed to be easier than copying over and editing the whole .Xsession.
#
# Don't put a window manager there! If you want to change the window manager,
# You'll need to copy over this whole file to your home directory as .Xsession.
#
if [ -f $HOME/.myXsession ]
then
	sh $HOME/.myXsession $1 &
fi

# We could use /usr/lib/X11/twm/system.twmrc, but then users could not
# as easily read our comments in the .twmrc.

if [ ! -r $HOME/.twmrc ]
then
	mv -f $HOME/.twmrc $HOME/.twmrc.old
	rm -f $HOME/.twmrc
	ln -s /p/etc/xdm/default-twmrc $HOME/.twmrc
fi

# Window manager. Notice this is not run in the background, so when we
# exit the window manager, we end the whole X session at the same time.
# This allows a friendly and easy "Logout" entry in a window manager
# menu.

twm -display "$DISPLAY" -singlescreen

# Fix framebuffer's colormap
/p/etc/mapfix

# EOF
