xrdp/sesman/startwm.sh

99 lines
1.8 KiB
Bash
Raw Normal View History

2010-07-26 05:52:12 +04:00
#!/bin/sh
2013-05-29 12:01:27 +04:00
#start the window manager
wm_start()
{
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
fi
# debian
if [ -r /etc/X11/Xsession ]; then
. /etc/X11/Xsession
exit 0
fi
# el
if [ -r /etc/X11/xinit/Xsession ]; then
. /etc/X11/xinit/Xsession
exit 0
fi
# suse
if [ -r /etc/X11/xdm/Xsession ]; then
. /etc/X11/xdm/Xsession
exit 0
fi
xterm
}
# Execution sequence for interactive login shell - pseudocode
#
# IF /etc/profile is readable THEN
# execute ~/.bash_profile
# END IF
# IF ~/.bash_profile is readable THEN
# execute ~/.bash_profile
# ELSE
# IF ~/.bash_login is readable THEN
# execute ~/.bash_login
# ELSE
# IF ~/.profile is readable THEN
# execute ~/.profile
# END IF
# END IF
# END IF
2013-05-29 12:01:27 +04:00
pre_start()
{
if [ -r /etc/profile ]; then
2013-05-29 12:01:27 +04:00
. /etc/profile
fi
if [ -r ~/.bash_profile ]; then
2013-05-29 12:01:27 +04:00
. ~/.bash_profile
else
if [ -r ~/.bash_login ]; then
2013-05-29 12:01:27 +04:00
. ~/.bash_login
else
if [ -r ~/.profile ]; then
2013-05-29 12:01:27 +04:00
. ~/.profile
fi
fi
fi
return 0
}
# When loging out from the interactive shell, the execution sequence is:
#
# IF ~/.bash_logout exists THEN
# execute ~/.bash_logout
# END IF
2013-05-29 12:01:27 +04:00
post_start()
{
if [ -r ~/.bash_logout ]; then
2013-05-29 12:01:27 +04:00
. ~/.bash_logout
fi
return 0
}
#. /etc/environment
#export PATH=$PATH
#export LANG=$LANG
# change PATH to be what your environment needs usually what is in
# /etc/environment
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
#export PATH=$PATH
# for PATH and LANG from /etc/environment
# pam will auto process the environment file if /etc/pam.d/xrdp-sesman
# includes
# auth required pam_env.so readenv=1
pre_start
wm_start
post_start
exit 1