#!/bin/sh # $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $ # # # $XFree86: xc/programs/xdm/config/Xsession,v 1.2 1998/01/11 03:48:32 dawes Exp $ # Modified for Slackware-3.5, 28-Mar-98 volkerdi # Extensively rewritten for Slackware 7.0, 03-Oct-1999 volkerdi # Patched to give priority to $HOME/.xsession, 10-Oct-1999 volkerdi # Merged changes into upstream (XFree86-4.0.2) version, 17-Feb-2001 volkerdi # Fixes for $PATH (from Jim Diamond), GDM/KDM/XDM, 2003-02-07 volkerdi # Patched for bizzare GDM $1, 2003-09-23 volkerdi # Heavily modified for bizzare Zenwalk, Wed Oct 3 10:54:10 CEST 2007 (JP) # Improved for better terminal color support by bizzare Mark Colclough Sat Jul 18 18:09:01 CEST 2009 # redirect errors to a file in user's home directory if we can for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xsession-errors-$USER" do if ( cp /dev/null "$errfile" 2> /dev/null ) then chmod 600 "$errfile" exec > "$errfile" 2>&1 break fi done SESSION="$@" userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap sysresources=/usr/lib/X11/xinit/.Xresources sysmodmap=/usr/lib/X11/xinit/.Xmodmap # merge in defaults and keymaps if [ -r $sysresources ]; then xrdb -merge $sysresources fi if [ -r $sysmodmap ]; then xmodmap $sysmodmap fi if [ -r $userresources ]; then xrdb -merge $userresources fi if [ -r $usermodmap ]; then xmodmap $usermodmap fi # We set up $PATH to reasonable defaults in case environment files are in vacation if [ "`whoami`" = "root" ]; then PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/games/bin" else PATH="/bin:/usr/bin:/usr/local/bin:/usr/games/bin" fi # Must set dircolors-compatible TERM before /etc/profile runs dircolors export TERM="xterm" # we should source these files to set up the user's environment profile=/etc/profile userprofile=~/.profile if [ -r $profile ]; then source $profile 1> /dev/null 2> /dev/null fi if [ -r $userprofile ]; then source $userprofile 1> /dev/null 2> /dev/null fi # These files (if they exist) are used to set up the X related environment if [ -r /etc/xprofile ]; then source /etc/xprofile fi if [ -r ~/.xprofile ]; then source ~/.xprofile fi # If a particular session type was requested in $SESSION, start that session exec $SESSION # If the previous session failed to start, then let's give a chance to the user's xinitrc if [ -x $HOME/.xinitrc ]; then exec $HOME/.xinitrc fi # If the user doesn't have their own .xinitrc and none was specified in # $SESSION, then run the system default session type: if [ -r /etc/X11/xinit/xinitrc ]; then exec /etc/X11/xinit/xinitrc fi # Executing $SESSION failed, will run xterm" exec xterm -geometry 80x24+0+0