#! /bin/bash #X Window Manager Chooser Script # run the default common X initialization scripts # By using ~/.Xclients instead of ~/.xinitrc # this is run automatically #source /etc/X11/xinit/xinitrc-common XCLIENTS=/home/$USER/.Xclients echo '*** Replacing existing ~/.Xclients or creating new one.' echo '#! /bin/bash' > $XCLIENTS echo ' ' >> $XCLIENTS chmod +x $XCLIENTS if [ "$1" = fb ]; then echo 'exec startfluxbox' >> $XCLIENTS echo 'Starting Fluxbox...' elif [ "$1" = ob ]; then echo 'exec openbox-session' >> $XCLIENTS echo 'Starting Openbox...' elif [ "$1" = fv ]; then echo 'exec fvwm' >> $XCLIENTS echo 'Starting FVWM...' elif [ "$1" = en ]; then echo 'xset b off s 10000 -dpms &' >> $XCLIENTS echo 'exec enlightenment_start' >> $XCLIENTS echo 'Starting Enlightenment (E17)...' elif [ "$1" = lx ]; then echo 'exec startlxde' >> $XCLIENTS echo 'Starting X with LXDE...' elif [ "$1" = xf ]; then echo 'exec startxfce4' >> $XCLIENTS echo 'Starting X with XFCE...' elif [ "$1" = xt ]; then echo 'exec xterm' >> $XCLIENTS echo 'Starting X with xterm...' elif [ "$1" = kd ]; then echo 'STARTKDE="$(type -p startkde)"' >> $XCLIENTS echo 'exec $STARTKDE' >> $XCLIENTS echo 'Starting X with KDE...' elif [ "$1" = gn ]; then echo 'GSESSION="$(type -p gnome-session)"' >> $XCLIENTS echo 'exec $GSESSION' >> $XCLIENTS echo 'Starting X with Gnome...' else echo -e "\n" echo -e "\n" echo Hello, $USER\! Which WM will it be this time? echo -e "\n" echo 'Type the two letter code for the window manager you want.' echo 'Fluxbox - fb ; Enlightenment (E17) - en ; Openbox - ob ; Xterm - xt ;' echo 'FVWM - fv ; XFCE - xf ; LXDE - lx ; KDE - kd ; GNOME - gn ;' echo 'Hitting enter on blank line will take the default, GNOME unless you change it.' echo 'Enter window manager code as argument to script and avoid this interaction.' echo 'Type Ctl-C to cancel selection.' read WMGR if [ "$WMGR" = fb ]; then echo 'exec startfluxbox' >> $XCLIENTS echo 'Starting Fluxbox...' elif [ "$WMGR" = ob ]; then echo 'exec openbox-session' >> $XCLIENTS echo 'Starting Openbox...' elif [ "$WMGR" = fv ]; then echo 'exec fvwm' >> $XCLIENTS echo 'Starting FVWM...' elif [ "$WMGR" = en ]; then echo 'xset b off s 10000 -dpms &' >> $XCLIENTS echo 'exec enlightenment_start' >> $XCLIENTS echo 'Starting E17...' elif [ "$WMGR" = lx ]; then echo 'exec startlxde' >> $XCLIENTS echo 'Starting X with LXDE...' elif [ "$WMGR" = xf ]; then echo 'exec startxfce4' >> $XCLIENTS echo 'Starting X with XFCE...' elif [ "$WMGR" = xt ]; then echo 'exec xterm' >> $XCLIENTS echo 'Starting X with xterm...' elif [ "$WMGR" = kd ]; then echo 'STARTKDE="$(type -p startkde)"' >> $XCLIENTS echo 'exec $STARTKDE' >> $XCLIENTS echo 'Starting X with KDE...' elif [ "$WMGR" = gn ]; then echo 'GSESSION="$(type -p gnome-session)"' >> $XCLIENTS echo 'exec $GSESSION' >> $XCLIENTS echo 'Starting X with Gnome...' else echo 'GSESSION="$(type -p gnome-session)"' >> $XCLIENTS echo 'exec $GSESSION' >> $XCLIENTS echo 'Default to starting X with Gnome...' fi fi sleep 3 startx exit 0