Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/profile1/shirshuverma/
Upload File :
Current File : /var/www/html/mmishra/profile1/shirshuverma/.xsession

#!/bin/bash
#
# .xsession
#

#
# If ssh is configured and ssh-agent is wanted set "yes"
#
usessh="no"

#
# What we do if we fail at least ... emergency fall back.
#
failsafe="xterm -ls -T Failsave -geometry 80x24-0-0"
trap "exec $failsafe" EXIT SIGHUP SIGINT SIGPIPE SIGTERM SIGIO

#
# Some bash (1 and 2) settings to avoid trouble on a
# failed program call.
#
test -n "$BASH" && set +o posix
no_exit_on_failed_exec=1
type shopt > /dev/null 2>&1 && shopt -s execfail
set +e > /dev/null 2>&1

#
# Save some settings
#
      __HOME="$HOME"         # Users HOME determined by xdm
   __DISPLAY="$DISPLAY"      # The DISPLAY set by xdm for this session
__XAUTHORITY="$XAUTHORITY"   # Should be empty in the most cases
readonly __HOME __DISPLAY __XAUTHORITY

#
# Read system and user profile if not already done
#
if test -z "$XSESSION_IS_UP" ; then
    readonly XSESSION_IS_UP=yes
    export XSESSION_IS_UP
    test -r /etc/profile && { . /etc/profile > /dev/null 2>&1 ; }
    set +u > /dev/null 2>&1
    test -r ${HOME}/.profile && { . ${HOME}/.profile > /dev/null 2>&1 ; }
    set +u > /dev/null 2>&1
fi

#
# Read the profile of tcsh users
#
case "$SHELL" in
*/csh|*/tcsh)
    while read env ; do
	var="${env%%=*}" ; val="${env#*=}"
	test "$var" = "umask"  && umask $val
	test "$var" = "$val"   && continue
	eval export $var="\$val"
    done < <($SHELL -c 'test -r /etc/csh.login && source /etc/csh.login;
			test -r $HOME/.login   && source $HOME/.login  ;
			printenv; echo -n umask=; umask')
    ;;
esac

#
# Restore
#
set +u > /dev/null 2>&1
      HOME="$__HOME"
   DISPLAY="$__DISPLAY"
XAUTHORITY="$__XAUTHORITY"

#
# Run ssh-agent only if ssh is configured and avaliable.
#
sshagent="no"
if test "$usessh" = "yes" -a -d $HOME/.ssh ; then
    type ssh-agent > /dev/null 2>&1 && sshagent="yes"
fi

if test -f $HOME/.xinitrc ; then
    if test "$sshagent" = "yes" ; then
	exec ssh-agent $HOME/.xinitrc
    else
	exec /bin/bash $HOME/.xinitrc
    fi
else
    test -n "$WINDOWMANAGER" && WINDOWMANAGER=`type -p $WINDOWMANAGER`
    if test -z "$WINDOWMANAGER" ; then
	if test -x /usr/X11R6/bin/kde ; then
	    WINDOWMANAGER=/usr/X11R6/bin/kde
	elif test -x /usr/X11R6/bin/startkde ; then
	    WINDOWMANAGER=/usr/X11R6/bin/startkde
	elif test -x /usr/X11R6/bin/fvwm2 ; then
	    WINDOWMANAGER=/usr/X11R6/bin/fvwm2
	elif test -x /usr/X11R6/bin/wmlist ; then
	    for i in `/usr/X11R6/bin/wmlist` ; do
		WINDOWMANAGER=`type -p $i`
		test -n "$WINDOWMANAGER" && break
	    done
	fi
    fi
    if test -z "$WINDOWMANAGER" ; then
	xmessage -timeout 10 -default okay -center -file - <<-EOF
		Error. Can not find a window manager.  Please install one.
		Exit for now.
		EOF
    else
	# Start the XIM server:
	test -r $HOME/.xim && source $HOME/.xim
	exec $WINDOWMANAGER
    fi
fi

# call failsafe
exit 0