dot/xinitrc: Wait for e16 to start, and tweak cursor after it does.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 29 Mar 2010 20:16:11 +0000 (20:16 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 29 Mar 2010 20:16:11 +0000 (20:16 +0000)
This should also stop xterms and the like getting in before E does and
ending up in the wrong places as a result.

dot/xinitrc

index 2ef2a18..f29eddd 100755 (executable)
@@ -109,8 +109,36 @@ case "$wm,$vnc" in
     ;;
 esac
 
-start-window-manager () {
+start-e16 () {
   run bginit $wm $wmopts
+  win=nil
+  for i in $(seq 10); do
+    if eesh version >/dev/null 2>&1; then
+      win=t
+      break
+    fi
+    sleep 1
+  done
+  case $win in
+    t)
+      info "$wm started ok"
+      run init xsetroot -cursor_name left_ptr
+      ;;
+    nil)
+      info "$wm failed to start!"
+      ;;
+  esac
+}
+
+start-window-manager () {
+  case $(type -t start-$wm || echo "not-found") in
+    function)
+      start-$wm $wmopts
+      ;;
+    *)
+      run bginit $wm $wmopts
+      ;;
+  esac
 }
 
 ###--------------------------------------------------------------------------