#!/usr/bin/bash -login # /etc/X11/wdm/Xsession # cleanup wdm resources /usr/bin/xrdb -load /dev/null # reset the background if specified if [[ `grep SET_BACKGROUND=1 /etc/wdm.conf |grep -v '#' 2> /dev/null` != "" ]] ; then xsetroot -bg black fi case $# in 1) case $1 in failsafe) exec xterm -geometry 80x24-0-0 ;; esac echo $1 > "$HOME"/.wm_style esac # redirect errors to a file in user's home directory if we can for errfile in ""$HOME"/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" do if ( cp /dev/null "$errfile" 2> /dev/null ) then chmod 600 "$errfile" exec > "$errfile" 2>&1 break fi done # Administrators or experienced users can have their way startup="$HOME"/.xsession if [ -s "$startup" -a -x "$startup" ]; then exec "$startup" fi # Otherwise merge in defaults and keymaps # system sysresources=usr/X11R6/lib/X11/xinit/.Xresources sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap if [ -r $sysresources ]; then /usr/bin/xrdb -load $sysresources fi if [ -r $sysmodmap ]; then /usr/bin/xmodmap $sysmodmap fi # user userresources="$HOME"/.Xresources usermodmap="$HOME"/.Xmodmap if [ -r $userresources ]; then /usr/bin/xrdb -merge $userresources fi if [ -r $usermodmap ]; then /usr/bin/xmodmap $usermodmap fi if [ -f "$HOME"/.Xdefaults ] ; then /usr/bin/xrdb -merge "$HOME"/.Xdefaults fi # xprofile if [ -r /etc/xprofile ]; then source /etc/xprofile fi if [ -r "$HOME"/.xprofile ]; then source "$HOME"/.xprofile fi # Another safe chance to bypass the rest. # Note that if "$HOME"/.Xclients is executable # we 'exec' it. But, if non-executable it gets # sourced and execution continues here. This # means you can use this to start programs # before the window manager is started. if [ -x "$HOME"/.Xclients ]; then # exec and don't come back here exec "$HOME"/.Xclients # elif [ -r "$HOME"/.Xclients ]; then # source the file and then come back # source "$HOME"/.Xclients fi # Now go to the system-wide Xclients if [ -x /etc/X11/wdm/Xclients ]; then exec /etc/X11/wdm/Xclients fi # if nothing else, start X's standard session manager if [ -x /usr/bin/xsm ]; then exec /usr/bin/xsm fi