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

Re: X Windows



On Tue, 14 May 1996, Susan G. Kleinmann wrote:

> > I installed fvwm2 but still get the xterm that comes as the default. 
> 
> If you start X with 'xinit' or 'startx' and do _not_ have an X startup
> script in your home directory, you will be punished by being presented with
> an X term that could only be read by people under the age of 20.
> You can circumvent this by including a file called ".xinirc" or ".xsession"
> in your home directory.  I recommend .xsession, since all of the three
> X startup methods (xinit, startx, and xdm) look for it.
> 
> Below please find my simple .xsession file.  It invokes 2 xterms, both with
> fonts big enough for me to see:
> 
> -----------------------------------------------------
> #!/bin/sh
> # This file is called by /etc/X11/xinit/xinitrc
> xrdb -load $HOME/.Xdefaults
> oclock -g +1152+0 &
> xterm -sb -sl 1500 -fn 12x24 -g 80x24+9+1 &
> xterm -sb -sl 1500 -fn 12x24 -g 80x24+291+418 &
> xsetroot -solid SteelBlue
> fvwm 
> -----------------------------------------------------

I'd suggest "exec fvwm" rather than "fvwm".  Why waste memory or swap
for the /bin/sh when it's no longer needed?

Here's my .xsession.  I've edited it to put extra comments in to explain
what's going on.

---cut here---~/.xsession---
#! /bin/sh

# all client programs (xterm, xbiff, tkdesk etc) should be run in
# background with &
#
# the window manager MUST NOT be run in background or xinit will think
# the X session is over as soon as it's loaded. 
#
# explanation: startx kills the X server when the .xsession script
# returns...if fvwm is backgrounded it will return when fvwm has been
# executed, otherwise it won't return until fvwm exits.

# load my resource database
xrdb -load ~/.Xdefaults

# allow gw.taz.net.au to open windows on my screen
xhost gw.taz.net.au

# steelblue makes a nice background colour
xsetroot -solid steelblue

# biff me
xbiff -geometry 48x48+925+1 -shape &

# run tkdesk desktop/file manager
tkdesk &

# give me an xterm
xterm &

# and finally, run my window manager.
exec fvwm
---cut here---~/.xsession---


It's also useful to set the XTerm resource defaults in ~/.Xdefaults:

here's a sample .Xdefaults file which sets the defaults for XTerms and
also does some neat stuff for keyboard maps in motif applications.
Thanks to someone on this list for the keybinding stuff - i can't
remember who it was but they posted it here a few days ago.

The "!" lines are comments.

---cut here---~/.Xdefaults---
! Xterm resources
!
*XTerm*foreground:  white
*XTerm*background:  blue
*XTerm*font:  9x15
!
! key bindings
!
*defaultVirtualBindings:  osfPageUp:     <Key>Prior \n\
           osfPageDown:   <Key>Next        \n\
           osfEndLine:    <Key>End         \n\
           osfBeginLine:  <Key>Home        \n\
           osfBackSpace:  <Key>Delete      \n\
           osfDelete:     <Key>Delete      \n\
           osfInsert:     <Key>Insert      \n\
           osfLeft:       <Key>Left        \n\
           osfUp:         <Key>Up          \n\
           osfDown:       <Key>Down        \n\
           osfRight:      <Key>Right       \n\
           osfCancel:      Ctrl <Key>g     \n\
           osfCut:         Ctrl <Key>w     \n\
           osfCopy:        Ctrl <Key>c     \n\
           osfPaste:       Ctrl <Key>y     \n\
           osfClear:       Ctrl <Key>k
!
*XmText.translations: #override\n\
           <Key>Delete: delete-previous-character()\n\
           <Key>BackSpace: delete-previous-character()\n\
           <Key>Right: forward-character()\n\
           <Key>Left: backward-character()\n
---cut here---~/.Xdefaults---


Craig


Reply to: