[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Here's a diff to my .xsession (was Re: Here's my .xsession)



Hi,

already found a problem: comment lines in /etc/X11/window-managers that
match the chosen favorite window manager cause the script to fail weirdly...
Problem reported by jodi@owns.stanford.edu

this patch filters comment lines first. (Note to Branden: you might want
to use this logic, or something like it, in the global Xsession.)

This also removes the debug echos that show which stanza finds the wm.

---
--- xs	Tue May 11 07:09:53 1999
+++ .xsession	Tue May 11 07:42:03 1999
@@ -21,28 +21,26 @@
 # start by assuming that before we start looking, we haven't found anything
 foundWM=false
 
-echo "1 $foundWM"
-
 # Favorite window manager
 
 # set this to your favorite WM, or to nothing if you're willing to accept
 # whatever comes
 myWM=fvwm2
 
+# try to find my favorite wm
 if [ "$foundWM" = "false" ]
 then
-    favWM=`grep $myWM /etc/X11/window-managers | head -1`
-    aWM=`echo $favWM | sed 's/#.*//'`
+    tmpWM=`grep -v "^#" /etc/X11/window-managers | sed 's/#.*//'`
+    favWM=`echo $tmpWM | grep $myWM | head -1`
 
     if [ -x "$aWM" ]
     then
-	theWM=$aWM
+	theWM=$favWM
 	foundWM=true
     fi
 fi
 
-echo "2 $foundWM"
-
+# try to find ANY wm (the first one found to be executable)
 if [ "$foundWM" = "false" ]
 then
     if [ -e /etc/X11/window-managers ]
@@ -59,8 +57,6 @@
     fi
 fi
 
-echo "3 $foundWM"
-
 # still didn't find a wm?? OK, twm isn't the best, but we'll settle
 
 if [ "$foundWM" = "false" ]
@@ -69,20 +65,19 @@
     foundWM=true
 fi
 
-echo "4 $foundWM"
-
 # launch the selected or otherwise found window manager in the background.
+# !!note!! the window manager is NOT the foreground process because it is
+#          NOT the session controller (as would be the traditional case).
 
 $theWM &
 
-# launch xearth and an xterm.
 xearth &
 #xfishtank &
 #xterm -ls &
 
 # launch the session-controlling process. If it dies, so does the session.
 
-#exec logout-button
+#exec logout-button # anyone wanna a logout button? send me mail :)
 exec gnome-session
 
 # end of .xsession
@@ -94,7 +89,7 @@
 # # NOTE: this part taken from the else part of the final "if"
 # # in the global /etc/X11/Xsession by jim@laney.edu
 # #
-# # i.e., look at this code as the default behavior and
+# # i.e., look at this code as the default session behavior and
 # # modify to taste
 #
 # xterm -ls &
---

-Jim


Reply to: