/usr/share/doc/sysprofile/examples/etc/X11/Xsession.sample is in sysprofile 0.3.8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | #!/bin/sh
#
# /etc/X11/Xsession
#
# global Xsession file -- used by both xdm and xinit (startx)
##########################################
##### Inserted for sysprofile usage ######
##### Don't use this sample file but #####
##### adapt your own /etc/X11/Xsession ###
if [ -f /etc/sysprofile ]; then
. /etc/sysprofile
fi
##### Inserted for sysprofile usage ######
##########################################
optionfile=/etc/X11/Xsession.options
sysmodmap=/etc/X11/Xmodmap
usrmodmap=$HOME/.Xmodmap
sysresources=/etc/X11/Xresources
usrresources=$HOME/.Xresources
startup=$HOME/.xsession
errfile=$HOME/.xsession-errors
startssh=
sshagent=/usr/bin/ssh-agent
if grep -qs ^use-ssh-agent $optionfile; then
if [ -x $sshagent -a -z "$SSH_AUTH_SOCK" ]; then
startssh=yes
fi
fi
if touch $errfile 2> /dev/null && [ -w $errfile ]; then
chmod 600 "$errfile"
elif errfile=$(tempfile 2> /dev/null); then
ln -sf "$errfile" "$TMPDIR/xsession-$USER"
else
# fatal error
echo "Xsession: unable to create X session error file. Aborting."
exit 1
fi
exec > "$errfile" 2>&1
case $# in
0)
;;
1)
case "$1" in
failsafe)
if grep -qs ^allow-failsafe $optionfile; then
if [ -e /usr/bin/x-terminal-emulator ]; then
if [ -x /usr/bin/x-terminal-emulator ]; then
exec x-terminal-emulator -geometry +1+1
else
# fatal error
echo "Xsession: unable to launch failsafe X session; x-terminal-emulator not"
echo " executable. Aborting."
exit 1
fi
else
# fatal error
echo "Xsession: unable to launch failsafe X session; x-terminal-emulator not found."
echo " Aborting."
exit 1
fi
fi
;;
default)
;;
*)
program=$(which $1)
if [ -e $program ]; then
if [ -x $program ]; then
startup=$program
else
echo "Xsession: unable to launch $1 X session; $1 not executable."
echo "Xsession: Falling back to default session."
fi
else
echo "Xsession: unable to launch $1 X session; $1 not found."
echo "Xsession: Falling back to default session."
fi
;;
esac
;;
*)
echo "Xsession: unsupported number of arguments ($#)."
echo "Xsession: Falling back to default session."
;;
esac
if [ -d $sysresources ]; then
for resourcefile in $sysresources/*; do
if [ -f $resourcefile ]; then
if expr $resourcefile : '.*/[[:alnum:]_-]*$' > /dev/null 2>&1; then
xrdb -merge $resourcefile
fi
fi
done
fi
if [ -x /usr/bin/X11/xmodmap ]; then
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
fi
if grep -qs ^allow-user-resources $optionfile; then
if [ -f $usrresources ]; then
xrdb -merge $usrresources
fi
fi
if [ -x /usr/bin/X11/xmodmap ]; then
if grep -qs ^allow-user-modmap $optionfile; then
if [ -f $usrmodmap ]; then
xmodmap $usrmodmap
fi
fi
fi
if [ -e $startup ] && grep -qs ^allow-user-xsession $optionfile; then
if [ -x $startup ]; then
realstartup=$startup
else
realstartup="sh $startup"
fi
elif [ -x /usr/bin/x-window-manager ]; then
realstartup=x-window-manager
fi
if [ -z "$realstartup" ]; then
if [ -x /usr/bin/x-terminal-emulator ]; then
realstartup=x-terminal-emulator
else
# fatal error
echo -n "Xsession: unable to start X session; "
if grep -qs ^allow-user-xsession $optionfile; then
echo -n "no $startup found, "
fi
echo "no window managers, and no terminal emulators found."
echo " Aborting."
exit 1
fi
fi
if [ "$startssh" ]; then
exec $sshagent $realstartup
else
exec $realstartup
fi
|