#!/usr/local/bin/bash ## ## RCSfile: .xsession,v ## Revision: 1.11 ## Date: 1998/09/29 04:47:53 ## ## NAME ## ~/.xsession -- X startup script ## ## DESCRIPTION ## When a new X session is started at login, xdm executes ## ${HOME}/.xsession if it's available, or a system default otherwise ## (/usr/lib/X11/xdm/Xsession). ## ## REQUIREMENTS ## bash ## ## INSTALLATION ## 1) Name this file .xsession and place it in your home directory ## 2) Make it executable (chmod 755 .xsession) ## 3) Customize PATH and windowmgr variables and Xsetup function below ## ## PROBLEMS ## Getting PATH set correctly for everyone... how to get this out of ## their .profile, .bash_profile, .cshrc, whatever ## ## LICENSE ## This source code is hereby released to the public domain and is unsupported. ## You are encouraged to copy and modify this file. Please clearly document ## modifications with authorship and motivation. Bug reports, code ## contributions, and suggestions are appreciated. ## ## SOURCE ## New versions of this file may be obtained from (as of 1998/11/08) ## http://www.in-machina.com/~reece/setup/xsession ## ftp://in-machina.com/pub/reece/setup/xsession ## ## AUTHOR ## Reece Hart, http://www.in-machina.com/~reece/, PGP:0xD178AAF9 ## Do not send unsolicited bulk email. Boycott companies which do so. ## [ -f ${HOME}/.bashrc ] && \. ${HOME}/.bashrc windowmgr=fvwm2 fvwmrc=${HOME}/.fvwm/fvwm2rc.m4 xerrors=${HOME}/.xsession-errors xsession=${HOME}/.xsession-`hostname` xmodmap=${HOME}/.Xmodmaprc xresource=${HOME}/.Xdefaults xhosts=${HOME}/.xhosts xinitdir=/usr/X11R6/lib/X11/xinit sysresources=$xinitdir/Xresources sysmodmap=$xinitdir/Xmodmap ################################################################################ ## You shouldn't need to modify any of the following ################################################################################ [ -f $xerrors ] && mv -f $xerrors $xerrors.bak exec >|$xerrors 2>&1 # log startup time and location date "+* $0: %Y/%m/%d %H:%M:%S: started on ${HOSTNAME}" # dump environment for debugging purposes env # if a platform-specific xsession exists, execute that instead if [ -f "$xsession" ]; then if [ -x "$xsession" ]; then exec "$xsession" else echo "$0: $xsession found but doesn't have execute permissions" fi fi # load any xmodmaps for file in $sysmodmap $xmodmap; do if [ -f "$file" ]; then (set -x; xmodmap "$file") fi done # load the xresources for file in $sysresources $xresource; do if [ -f "$file" ]; then (set -x; xrdb -merge "$file") fi done if [ "$1" = "failsafe" ] || ! type "$windowmgr" >/dev/null 2>&1; then echo "$0: failsafe caught or $windowmgr doesn't exist" xterm -geometry 80x24+0+0 exit 0 fi # strict access control; users may add routine X clients to $xhosts xhost - for file in $xhosts; do if [ -f "$file" ]; then xargs -n1 xhost <"$file" fi done # if suffix is m4, preprocess with FvwmM4 if [ "${fvwmrc##*.}" = "m4" ]; then fvwmrc="-cmd 'FvwmM4 -debug $fvwmrc'"; else if [ "${fvwmrc##*.}" = "cpp" ]; then fvwmrc="-cmd 'FvwmCpp $fvwmrc'"; fi fi echo $windowmgr $fvwmrc eval $windowmgr $fvwmrc >/dev/console 2>&1