fi
done
-# exec specified session or tell user if not found
-loadsess()
-{
- if [ -f "$HOME/bin/$sess.sh" ]; then
- exec "$HOME/bin/$sess.sh"
- else
- [ `/usr/bin/which $sess` ] && exec $sess || exec xmessage -center \
- -buttons OK:0 -default OK "Sorry, $sess not found."
- fi
-}
-
-# now, we see if xdm/gdm/kdm has asked for a specific environment
+# Keep in sync with Xclients from xinitrc-ng
+syswmfile="/etc/sysconfig/desktop"
+
+# In this file "$wmstyledir" value may be given
+[ -f "$syswmfile" ] && . $syswmfile
+
+if [ -z "$wmstyledir" ]; then
+ # Keep in sync with Xclients from xinitrc-ng
+ wmstyledir="/etc/sysconfig/wmstyle"
+fi
+
case $1 in
failsafe)
exec xterm -geometry 80x24-0-0
;;
- gnome)
- sess=gnome-session
- loadsess
- ;;
- kde)
- sess=startkde
- loadsess
- ;;
- windowmaker)
- sess=wmaker
- loadsess
- ;;
- xfce)
- sess=startxfce
- loadsess
- ;;
- xfce4)
- sess=xfce4-session
- loadsess
- ;;
""|default)
# take default action
- if [ -f "$HOME/.Xclients" ]; then
+ if [ -x "$HOME/.Xclients" ]; then
exec "$HOME/.Xclients"
else
exec /etc/X11/xinit/Xclients
fi
;;
+ custom)
+ if [ -x "$HOME/.xsession" ]; then
+ exec "$HOME/.xsession"
+ else
+ exec xmessage -center -buttons OK:0 -default OK \
+ "Sorry, $HOME/.xsession not found."
+ fi
+ ;;
*)
- sess=$1
- loadsess
+ if [ -x "$HOME/bin/$1.sh" ]; then
+ exec "$HOME/bin/$1.sh"
+ elif [ -x "$wmstyledir/$1.sh" ]; then
+ exec "$wmstyledir/$1.sh"
+ else
+ [ `/usr/bin/which $1` ] && exec $1 || exec xmessage -center \
+ -buttons OK:0 -default OK "Sorry, $1 not found."
+ fi
esac