+ tag=*) atomtag=/${opt#tag=} ;;
+ trace) set -x ;;
+ notrace) set +x ;;
+ info | run | start | wait | vnc) eval "$opt=yes" ;;
+ noinfo | norun | nostart | nowait | novnc) eval "${opt#no}=no" ;;
+
+ *) echo "unknown option $opt" >&2; exit 1 ;;
+ esac
+done
+
+###--------------------------------------------------------------------------
+### Iniitial settings.
+
+## Assume X sessions are secure.
+export __mdw_sechost="`hostname`"
+
+## Obtain the screen dimensions.
+case ",$XWIDTH,$XHEIGHT," in
+ *,,*) eval $(xscsize -bx) ;;
+esac
+info "screen size = $XWIDTH x $XHEIGHT"
+
+initialize () {
+ ## Load the X resource database.
+ run init xrdb -override $HOME/.Xdefaults
+
+ ## Random xsettery.
+ run init xset b 10 2000 50
+ run init xset r rate 500 50
+ run init xset m 2 1
+
+ ## Gnome settings.
+ case $vnc in no) run bginit gnome-settings-daemon ;; esac
+}
+
+###--------------------------------------------------------------------------
+### Start a window manager.
+
+wm=$(pick_program window-manager enlightenment e16 twm)
+wmopts=""
+case "$wm,$vnc" in
+ enlightenment,yes | e16,yes)
+ wmopts="$eopts -econfdir $HOME/.enlightenment-vnc"
+ ;;
+esac
+
+start-window-manager () {
+ run bginit $wm $wmopts
+}
+
+###--------------------------------------------------------------------------
+### Random useful clients.
+
+start-clients () {
+ ## Mail notification.
+ run bginit mail-notification
+
+ ## System monitor.
+ case $vnc in no) run bginit gkrellm ;; esac
+
+ ## Screensaver.
+ case $vnc in
+ no)
+ run init xscreensaver-command -exit
+ run bginit xscreensaver -no-splash
+ ;;
+ esac
+
+ ## Panel.
+ case $vnc in no) run bginit gnome-panel ;; esac
+}