On Fri, 6 Jan 2012 22:28:26 +0200
"Nadav Har'El" <[email protected]> wrote:
| On Thu, Jan 05, 2012, Aaron Sloman wrote about "Re: [ctwm] [ANNOUNCE] CTWM 
3.8.1 released":
| Basically, the simple "neaper" tool just creates a root-window property and
| then hangs around until someone deletes this property. If you put "neaper"
| as the last command in ~/.ctwmrc, you are free to kill your window manager,
| and the session only ends when you remove the property, with a command like:
| 
|       xprop -root -remove _NYH_NEAPER_PROPERTY
| 
| If anyone is interested in my respawn script or neaper tool, let me
| know.
| 
| Nadav.
| 
It is a nice idea.  and using a small xterm is good too.

But I do something different.

First my .xsession just loads my environment and runs .xinitrc
That brings it in line with the 'startx' use of ".xinitrc"

My ".xinitrc" sets up basic display stuff (resources, keyboard maps etc)
but then goes into a loop.

The loop runs a ".xclient.HOSTNAME" script that is appropriate for the
machine I use.   It runs the window manager, and all clients I want
running at start up. Actually over the year (25 now) it go so far as to
calcuate a tiling of xterminal sizes and positions appropriate form my
display!

The "xinitrc" then runs a program to open a small window in the
lower right corner of the display.  Typically this small window has just
a small icon of button or door, to represent an exit.  This is the
"logout" button, designed so that pressing it just exits without
error.

The exact program used for the logout button vary depending on what programs
is available.  Typically it is a "xlabel" (ultra simple X button), but I
it could also use "xmessage" or "xlogo" with warped resources so a mouse
press will exit without error.  It could even be a "zenity" "Xdialog"
or just a very small xterm waiting on a 'return'.

For example...
  


The xinitrc loop continues, and on 'bad' exit, it will just "closedown"
and exit (display or button killed for some reason) but on normal exit
it will pop up a "xmessage" (or "other menu program) asking if the user
wants to poweroff, reboot, logout, restart (kill all x apps and re-run 
xclients),
or simple cancel (default).

Unless I cancel (or menu timesout) I use the "xclosedown" program that
specifically kills all X window applications running, without killing
the X display (full cleanup).

The point of this 'xclient - logout - Menu' loop in my ".xinitrc" is
that I can at any time modify my .xclients, and change things when I
want. It protects me from rogue or bug applications, and saves me should
I accidentally hit the logout button my accident.

I can kill the window manager, panels, or anything else and restart new
ones. I do not need a supervising "session" or run a any specify
application. My main ".xinitrc" script rarely changes, and I can have
different session setups for different machines using the same home
(whether it is a copy of my primary home, or a NFS mount).


I can even 'try out' other configurations or applications as I like.

One thing I may do is add a 'lock' to the exit menu, but so far I have
kept that separate, as the lock program seems to be too variable from
installation to installation.

Example 'logout button'

    xmessage -name xlogout -title xlogout \
        -geometry -5-30 -fg Gold -bg Navy \
        -buttons "" -xrm '*message.borderWidth: 0' \
        -xrm '*baseTranslations: #override <BtnDown>: exit(0)' \
        -xrm '*message.scrollVertical: false' \
        -xrm 'controls*highlightThickness: 0' \
        -xrm '*Font: -*-new cent*-bold-r-normal--24-*' \
        Logout

Example 'menu'

   buttons='Poweroff:14,Reboot:13,Restart:12,Logout:11,Cancle:0'
   xmessage -name xlogout -title xlogout \
      -geometry -5-30 -fg Gold -bg Navy  -buttons "$buttons" \
      -xrm '*message.borderWidth: 0' \
      -xrm '*message.scrollVertical: Never' \
      -xrm '*Font: -*-new cent*-bold-r-normal--18-*' \
      'Are You Sure?'

Of course over many years it is more complica

  Anthony Thyssen ( System Programmer )    <[email protected]>
 --------------------------------------------------------------------------
                  This signature is lying to you.
 --------------------------------------------------------------------------
   Anthony's Castle     http://www.ict.griffith.edu.au/anthony/

Reply via email to