#!/usr/bin/bash -login ######################################################################## # -*- sh -*- # # # # ~/.Xclients: used by startx (xinit) to start up a window manager and # # any other clients you always want to start an X session with. # # # # This version of Xclients is intended for use with wdm. This # # separate file is used rather than the Red Hat Linux Xclients # # file located as /etc/X11/xinit/Xclients because it has been # # extensively modified to handle starting many different window # # or session managers and do that on systems other than Red Hat Linux. # # # # Systems other than RedHat Linux will like need editing of this # # file to tailor the file for the particular system. # # # ######################################################################## # try to find executable in PATH FindInPath() { prog=$1 shift result= for p in `echo $PATH|tr ':' ' '`; do if test -e $p/$prog; then result=$p/$prog break; fi done } # check for and set x-resources if [ -f $HOME/.Xresources ] ; then /usr/X11R6/bin/xrdb -merge $HOME/.Xresources fi if [ -f $HOME/.Xdefaults ] ; then /usr/X11R6/bin/xrdb -merge $HOME/.Xdefaults fi # First thing - check the user preferences if [ -f $HOME/.wm_style ] ; then WMSTYLE=`cat $HOME/.wm_style` case "$WMSTYLE" in xfce*|XFCE*) # startup XFCE XFCE_PATH=/usr/bin/startxfce4 if ! test -x $XFCE_PATH ; then FindInPath $XFCE_PATH if test -n "$result" -a -x "$result"; then XFCE_PATH="$result"; fi fi if test -x $XFCE_PATH ; then echo Starting XFCE >$HOME/.xwm.msgs env > "$HOME"/Xrootenv.0 exec $XFCE_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; fluxbox*|FluxBox) # startup fluxbox FLUXBOX_PATH=/usr/X11R6/bin/startfluxbox if ! test -x $FLUXBOX_PATH ; then FindInPath $FLUXBOX_PATH if test -n "$result" -a -x "$result"; then FLUXBOX_PATH="$result"; fi fi if [ -x $FLUXBOX_PATH ] ; then echo Starting Fluxbox >$HOME/.xwm.msgs exec $FLUXBOX_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; wmaker*|WindowMaker*) # startup WindowMaker WMAKER_PATH=/usr/bin/wmaker if ! test -x $WMAKER_PATH ; then FindInPath $WMAKER_PATH if test -n "$result" -a -x "$result"; then WMAKER_PATH="$result"; fi fi if test -x $WMAKER_PATH ; then echo Starting WindowMaker >$HOME/.xwm.msgs env > "$HOME"/Xrootenv.0 exec $WMAKER_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; twm*|TWM*) # startup TWM TWM_PATH=/usr/X11R6/bin/twm if ! test -x $TWM_PATH ; then FindInPath $TWM_PATH if test -n "$result" -a -x "$result"; then TWM_PATH="$result"; fi fi if test -x $TWM_PATH ; then echo Starting TWM >$HOME/.xwm.msgs env > "$HOME"/Xrootenv.0 exec $TWM_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; kde*|KDE*) # startup KWM KDE_PATH=/opt/kde/bin/startkde if ! test -x $KDE_PATH ; then FindInPath $KDE_PATH if test -n "$result" -a -x "$result"; then KDE_PATH="$result"; fi fi if test -x $KDE_PATH ; then echo Starting KDE >$HOME/.xwm.msgs env > "$HOME"/Xrootenv.0 exec $KDE_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; fvwm95*|FVWM95*) # startup FVWM95 FVWM95_PATH=/usr/X11R6/bin/fvwm95 if ! test -x $FVWM95_PATH ; then FindInPath $FVWM95_PATH if test -n "$result" -a -x "$result"; then FVWM95_PATH="$result"; fi fi if test -x $FVWM95_PATH ; then echo Starting FVWM95 >$HOME/.xwm.msgs env > "$HOME"/Xrootenv.0 exec $FVWM95_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; fvwmunstable*|FVWMUnstable*) # startup FVWM unstable FVWMUNSTABLE_PATH=/usr/bin/fvwm if ! test -x $FVWMUNSTABLE_PATH ; then FindInPath $FVWMUNSTABLE_PATH if test -n "$result" -a -x "$result"; then FVWMUNSTABLE_PATH="$result"; fi fi if test -x $FVWMUNSTABLE_PATH ; then echo Starting FVWMUNSTABLE >$HOME/.xwm.msgs env > "$HOME"/Xrootenv.0 exec $FVWMUNSTABLE_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; fvwm*|FVWM*) # startup FVWM FVWM_PATH=/usr/X11R6/bin/fvwm if ! test -x $FVWM_PATH ; then FindInPath $FVWM_PATH if test -n "$result" -a -x "$result"; then FVWM_PATH="$result"; fi fi if test -x $FVWM_PATH ; then echo Starting FVWM >$HOME/.xwm.msgs env > "$HOME"/Xrootenv.0 exec $FVWM_PATH >>$HOME/.xwm.msgs 2>&1 fi ;; xsession*|Xsession*) # startup xsession XSESSION_PATH=xsession if ! test -x $XSESSION_PATH ; then FindInPath $XSESSION_PATH if test -n "$result" -a -x "$result"; then XSESSION_PATH="$result"; fi fi if [ -x $XSESSION_PATH ] ; then echo Starting xsession >$HOME/.xwm.msgs exec $XSESSION_PATH -console >>$HOME/.xwm.msgs 2>&1 fi ;; esac fi # No other window or session manager found. # Use twm as a last resort. # xterm & 2>&1 # exec twm 2>&1 killall wdm ; exec init 3