
----------------------------------------------------------------------

Q: What is Babaya?

A: Babaya is a simple session manager for the X Window System. Babaya
   takes care of starting the user's custom applications when logging
   in or starting the server, and of ending all applications
   gracefully when the user desires to log out or exit the server.

----------------------------------------------------------------------

Q: What does Babaya do for me?

A: Two things:
   
   1) It launches the user's custom applications listed in Babayas's
      startup file.

   2) It takes care of ending all applications gracefully when the
      user wants to logout or exit the server. This is much better
      than abruptly killing all active application by exitting the
      server without giving those applications the chance to exit
      gracefully. The latter method is ``too violent'' in my opinion
      and often leaves residual process still active even after the
      server is shut down.

----------------------------------------------------------------------

Q: How does Babaya work?

A: When you start Babaya, it first launches all applications listed in
   its startup file, ~/.babaya/startup, which has the same format as
   any sh shell script (actually it *is* a shell script). Babaya put
   error message encountered while processing the startup file in the
   file ~/.babaya/startup-errors.

   Afterwards, Babaya creates a logout button at the buttom right
   corner of the screen. When the user clicks that button WITH THE
   RIGHT MOUSE BUTTON (to avoid potential mishapes), Babaya first
   sends all applications the WM_DELETE_WINDOW message. Applications
   participating the WM_DELETE_WINDOW protocol (all decent ones do,
   including Babaya of course!) respond to that message by exiting
   gracefully (e.g. in Seyon it's as if the user clicked the Exit
   button on its command center). 

   Babaya then waits ten seconds for applications to clean up and
   exit. Afterwards, it kills all remaining applications (those not
   participating in the above protocol) and exits. At that time, the
   user would be logged out and returned to the xdm login dialog (if
   xdm is used), or the server will exit and the user will return to
   the shell (if the server is started manually by startx, ..etc.).

----------------------------------------------------------------------

Q: How do I build and install Babaya?

A: Simple. To build it, just type:

           xmkmf
           make install

   Then put the line 

            babaya &

   somewhere in your .xinitrc file (if you start the server manually)
   or .xsession file (if you use xdm). You can also launch Babaya in
   the foreground (i.e. without the ampersand ``&'') as the last line
   in your .xinirc or .xsession files. See the follwoing question for
   details. 

   If you want Babaya to automatically launch custom applications for
   you (e.g. xterm, the window manager, ..etc.), put them in the file
   ~/.babaya/startup. An example startup file is included.

----------------------------------------------------------------------

Q: How should the recommended .xinitrc look like?

A: Like this:

        foo &
        bar &
        window-manager &
        babaya &
        wait $!

(note the $! variable)

   Then you can exit the server without first exiting all clients
   manually, simply by clicking on Babaya's logout button. Babaya
   handles closig all clients gracefully (sends all of them the
   WM_DELETE_WINDOW protocol message, waits a few seconds for them to
   clean up and exit, then finishes off the nasty remaining ones)
   before shutting down the server. And you won't get any zombies this
   way.
    
   If you omit the babaya line in the above example, you'll still be
   able to exit the server without killing all clients manually (by
   exiting the window manager in this case), but you'll end up with
   orphaned processes / zombies if you don't kill all multi-process
   clients (xcomm, ..etc.) manually before exiting, since none of the
   clients will have time to clean up. You also won't be able to
   change window managers this way.

   It is _not_ recommended that your .xinitrc looks like this:

        foo &
        bar &
        window-manager

   since in this case the shell will be busy with the last command
   (the window manager) and will not properly wait on exiting clients,
   so if you exit an application launched from .xinitc (e.g. foo or
   bar) it will become a zombie until the server is shut down.


----------------------------------------------------------------------

Q: What are Babaya's resources?

A: Besdies the toolkit resources, Babaya defines the following
   proprietry resources;
   
   launchStartupApps:
      If set to off (default), Babaya will not launch any program in
      it's startup files, and vice-versa.

   waitTime:
      This specifies the amount of time in seconds given to clients to
      clean up and exit. In other words, the delay between sending
      clients the WM_DELETE_WINDOW protocol messgae (the `please clean
      up and exit' messgae), and killing them (the `die sucker'
      message). Most clinets will clean up and exit after the initial

      message. The default is 10.

----------------------------------------------------------------------

Q: What are Babaya's switches?

A: Besdies the toolkit switches, Babaya defines the following
   proprietry resources;

   -startupapps, -nostartupapps. 
      These override the resource launchStartupApps. The first causes
      Babaya to launch startup applications in its startup file, the
      latter does the opposite.

   -waittime <time>: 
      Overrides the resource waitTime.

----------------------------------------------------------------------
         
Q: Who is the author of Babaya? How can I contact him (for thanks and
   praise, not flame :->).

A: Muhammad M. Saggaf
   e-mail:     alsaggaf@mit.edu
   Snail Mail: Muhammad Saggaf
               Box 9863
               Dhahran 31311
               SAUDI ARABIA

----------------------------------------------------------------------
