Date: Sat, 19 Jun 1999 09:32:27 -0700 (PDT) From: Bart Trzynadlowski <trzy@powernet.net> To: "J.M. Paden" <jmpaden@mnsinc.com> Cc: freebsd-questions@freebsd.org Subject: Re: x configuration files Message-ID: <Pine.BSF.4.05.9906190928140.344-100000@Brzuszek> In-Reply-To: <376b98fa.502485321@relay.mnsinc.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks, that was what I was looking for! However I modified my xinitrc
file but now X goes to the point where it displays that gray-ish weaving
background with an X cursor and just quits. The only message is something
about XKEYBOARD keymap compiler and that errors here are not fatal to the
X server. Yet it shuts down anyway. My xinitrc is included below. I
changed nothing except for what is below the "# start some nice programs"
line. Everything else was originally in the xinitrc file. Thanks for the
help!
#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi
# start some nice programs
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
wmaker &
On Sat, 19 Jun 1999, J.M. Paden wrote:
> On Fri, 18 Jun 1999 18:25:43 -0700, you wrote:
>
> >Hi,
> > I just started using X11 (with XFree86 under FreeBSD) and was
> >wondering where the configuration files are. I have set up the basic
> >configuration but I need to know where the systemwide xinitrc file is. I
> >could not locate one in my system. X starts with twm as the default
> >window manager and runs clock, two xterms, and something called "login"
> >which is just a shell. The latter seems to have been executed last
> >because when I exit it the whole X session is killed. I know how to set
> >up .xinitrc files in users' home directories but I think a system-wide
> >file would be better. Are there any other important configuration files
> >that I should know about? Any good X resources out there to read up on?
> >
> >Thanks a lot,
> >
> >Bart Trzynadlowski
> >(reply by email if possible)
> >
> >
> The following are some of mynotes plus copies of newsgroup articles
> that may be of help.
>
> Xbasics
>
> 1. This is a description of the files which are involved when a user
> invokes X window in Linux. Some basic information about how these
> files are used to configure X and some trouble shooting suggestions
> are also provided.
>
> 2. List of important X-related files:
>
> a. /etc/profile - systemwide environmental variables.
>
> b. ~/.profile - user defined environmental
> variables.
>
> c. /usr/X11R6/bin/xinit - binary that initiates X window.
>
> d. /usr/X11R6/bin/startx - shell script which is an improved
> front
> end to X. It is started
> from command line.
>
> e. /usr/X11R6/bin/xdm - initiates running of X window and
> provides a graphical login. It is usually
> started from /etc/inittab.
>
> f. /usr/X11R6/lib/X11/xinit/xinitrc
> - systemwide default file run
> by xinit or startx. Contains
> calls to other configuration files
> and identifies which applications
> and window manager to run.
>
> g. ~/.xinitrc - user defined version of
> xinitrc.
>
> h. /usr/X11R6/lib/X11/xinit/.Xresources
> - systemwide default
> configuration file for all X
> applications.
>
> i. ~/.Xresources -user defined version of .Xresources
> which
> modifies the system defaults.
> This file is
> sometimes named
> "~/.Xdefaults".
>
> j. /usr/X11R6/lib/X11/xinit/.Xmodmap
> - default keymap used in X.
>
> k. ~/.Xmodmap - user defined keymap.
>
> l. /usr/X11R6/lib/X11/app-defaults/<application name>
> - a series of files, each
> named for one of the X
> applications, which contain default
> configuration information.
>
> m. /usr/X11R6/lib/X11/xinit/xserverrc
> - ???????????????
>
> n. ~/.xserverrc - ???????????????
>
> o. /usr/X11R6/lib/xdm/Xservers
> - starts the X server on the
> local display with a call to :0
> local /usr/X11R6/bin/X
>
> p. ~/.xsession - identical to ~/.xinitrc, but
> used with xdm.
>
> q. ~/.fvwmrc - window manager configuration
> file.
>
> r. /usr/X11R6/bin/XF86_SVGA - X window manager
>
> s. /usr/X11R6/bin/X - Empty file pointed to by various
> initiation files. It is used
> as a symbolic link to the X server
> being used.
>
>
>
> 3. Additional Comments on X related files:
>
>
> . etc/profile and ~/.profile
>
> These files include PATH (to X11R6 executables) and other environment
> variables used by ~/.xinitrc and the various xclients. One important
> entry is the definition of the display to be used by the X server:
> export DISPLAY=:0.0
> It is essential that the PATH statement include /usr/X11R6/bin and
> /usr/X11/bin. The MANPATH should include /usr/X11/man.
>
> . /usr/X11R6/bin/xinit
>
> Since this is a binary file, it will be installed automatically when
> XF86 is installed. It is normally not called from the command line,
> but if
> it is, it will skip the configurations contained in ~/.xinitrc.
>
>
>
>
> . startx
>
> startx is a scriptfile which performs like xinit. It checks to see if
> there is a ~/.xinitrc file. If it does not exist, startx will call on
> the directions contained in the default script located in
> /usr/X11R6/lib/X11/xinit/xinitrc. startx will then check to see if
> there is a ~/.xserverrc file. It runs the .xserverrc script, which
> executes the specified XF86 server--in my case, /usr/X11R6/XF86_SVGA.
>
> If one does not exist, startx will call on the directions contained in
> the default script located in /usr/X11R6/lib/X11/xinit/xserverrc.
> This uses the default "X:0". X indicates the file /usr/X11R6/bin/X
> which is a pointer to the file XF86_SVGA. It is the responsibility of
> the sysadmin to make sure that the proper link is made between X and
> the appropriate server.
>
> There is also a place in the startx script where user or server
> arguments can be placed which can control the mode used when the X
> window is opened. You can place commands to kill the gpm (general
> purpose mouse) which causes problems in X window and then to restart
> gpm as you close X. startx is usually run without any arguments,
> although the user can specify a temporary change in the bpp setting by
> using a command like startx -- -bpp 16 (this will provide a depth of
> 16). To make such a setting permanent it must be included in the
> startx file itself or in /root/.xinitrc or ~/.xinitrc. It would also
> be possible to do this by using the startx file itself by modifying
> the lines (see below)
> serverargs=""
> to
> serverargs="-bpp 16"
> or
> serverargs="-bb 16 -depth 555"
>
> The actual work is done by the contents of the scriptfile ~/.xinitrc
> or xinitrc. The ~/.xserverrc and xserverrc files merely identify the
> server being used.
>
> You can kill the session started with startx by using
> CTRL-ALT-BACKSPACE
> -------------------------------------------------------------------------
> THE FOLLOWING IS AN EXAMPLE OF A STARTX SCRIPT WITH EXPLANATIONS
>
> #!/bin/sh
>
> # $XConsortium: startx.cpp,v 1.4 91/08/22 11:41:29 rws Exp $
> # $XFree86: xc/programs/xinit/startx.cpp,v 3.0 1994/05/22 00:02:28
> dawes Exp $
> #
> # This is just a sample implementation of a slightly less primitive
> # interface than xinit. It looks for user .xinitrc and .xserverrc
> # files, then system xinitrc and xserverrc files, else lets xinit
> choose
> # its default. The system xinitrc should probably do things like
> check
> # for .Xresources files and merge them in, startup up a window
> manager,
> # and pop a clock and serveral xterms.
> #
> # Site administrators are STRONGLY urged to write nicer versions.
> #
>
> ##The following files are searched in order. It would be normal for
> an .xinitrc file to exist in the home directory ##of either root or
> another user. $HOME/.xinitrc would refer to both /root/.xinitrc or
> ~/.xinitrc depending on ##whether root or a user initiated startx.
>
> userclientrc=$HOME/.xinitrc
> userserverrc=$HOME/.xserverrc
> sysclientrc=/usr/X11R6/lib/X11/xinit/xinitrc
> sysserverrc=/usr/X11R6/lib/X11/xinit/xserverrc
> clientargs=""
> serverargs=""
>
> ##Many users have difficulty using a mouse in X windows because of a
> conflict with the gpm #program (general purpose mouse??) which is used
> outside of X window. You must kill the #gpm program before starting
> X. If you fail to do so your X-mouse is very erratic. You #can use an
> entry at the beginning and end of your startx script to automate the
> killing #of gpm when startx is initiated and then restoring gpm to use
> when you exit X window. #The following is the text to use for this
> purpose. See the additional text at the end of #the startx script.
> MOUSE_TYPE=`ls -l /dev/mouse`
> export MOUSE_TYPE;
> export GPM_IS_DEAD;
> MOUSE_TYPE=`echo $MOUSE_TYPE`
> MOUSE_TYPE=`echo $MOUSE_TYPE | cut -f 11 -d ' '`
> GPM_IS_DEAD=""
> if [ "$MOUSE_TYPE"= "psaux" ]; then
> echo "Killing gpm..."
> gpm -k
> GPM_IS_DEAD=true
> sleep 1
> fi
> ##This is the end of the first of the two-part mouse script.
>
>
>
> if [ -f $userclientrc ]; then
> clientargs=$userclientrc
> else if [ -f $sysclientrc ]; then
> clientargs=$sysclientrc
> fi
> fi
>
>
>
>
> if [ -f $userserverrc ]; then
> serverargs=$userserverrc
> else if [ -f $sysserverrc ]; then
> serverargs=$sysserverrc
> fi
> fi
>
> whoseargs="client"
> while [ "x$1" != "x" ]; do
> case "$1" in
> /''*|\.*) if [ "$whoseargs" = "client" ]; then
> clientargs="$1"
> else
> serverargs="$1"
> fi ;;
> --) whoseargs="server" ;;
> *) if [ "$whoseargs" = "client" ]; then
> clientargs="$clientargs $1"
> else
> serverargs="$serverargs $1"
> fi ;;
> esac
> shift
> done
>
> xinit $clientargs -- $serverargs
>
> ##This is the second part of the mouse script:
> if [ "GPS_IS_DEAD"="true" ]; then
> touch /tmp/script.$$
> chmod 700 /tmp/script.$$
> grep gpm /etc/rc.d/rc.local >> /tmp/script.$$
> . /tmp/script.$$
> rm -f /tmp/script.$$
> fi
> ##end of the second part of the mouse script
>
>
> ##end of startx example
> ------------------------------------------------------------------------
>
>
> . xdm
>
> xdm is the X display manager. It is used frequently when the system
> launches X window at bootup. It is generally started by an entry in
> the /etc/inittab file which selects the runtime level. The number
> assigned to xdm differs from Linux distribution to distribution. In
> Slackware, a runlevel of 4 will start xdm automatically.
>
> You can also run xdm as root on the command line:
> xdm -nodaemon
> The -nodaemon option prevents xdm from running in the background.
>
> xdm resets or starts an X server (such as XF86_SVGA) and runs the
> script file /usr/X11R6/lib/X11/xdm/Xsetup_0. which prepares the screen
> and displays the login. This by default opens a single console for
> the login widget. To place a background behind the login message you
> can edit the Xsetup_o file to include:
> xlock -nolock -enablesaver -inrooot -mode swirl&
> Since xlock is run in the background, you must kill it in the
> GiveConsole file with:
> and entry:
> killall xlock
>
> or
> xv -quit -rmode 4 -root <name of .gif file>
>
> When the login message appears, the user enters login name and
> password. Once this is verified, the ~/.xsession file is run. This
> file is normally identical to ~/.xinitrc which is used with startx.
> It is common to just have a symbolic link between the two files:
> ln -s .xinitrc .xsession
> If a different .xsession file is desired, you can copy the .xinitrc
> and rename it .xsession. This file must also be executable:
> chmod o+x .xsession
>
> To use -bpp 16 -bpp using XDM. Change the following line in
> /var/X11R6/lib/xdm/Xservers:
>
> :0 local /usr/X11R6/bin/X
> to
> :0 local /usr/X11R6/bin/X -bpp 16
>
> You could also put a command in a file .xserverrc :
> exec X -bpp 16
> To use -bpp 16 -bpp 24 -bpp 32 when using XDM put the option after 'X'
> in /etc/X11/xdm/Xservers.
>
>
> . ~/.xinitrc
>
> This defines which clients are started, the size of windows, which
> fonts are used in the windows, what menu options are available and
> which window manager is to run. When startx is used, the ~/.xinitrc
> file is read and the commands in it are executed. It can be helpful to
> have .xinitrc to call on /etc/profile so that environment settings are
> available to X. You could include the following in .xinitrc:
> #!/bin/bash
> if [ -f /etc/profile ]; then
> . /etc/profile
> fi
>
>
> ~/.xsession
> When you log onto an X console, xdm reads the ~/.xsession file and
> the commands in it are executed. It (and the identical .xinitrc file)
> might indicate how many xterm windows to open,perhaps an xemac window,
> a clock or which colours to use. It is important that .xinitrc contain
> a full PATH statement.
>
> Note: The .xinitrc file and the .xsession file have identical
> contents. It is normal for .xinitrc to be linked to .xsession.
> ln -s .xsession .xinitrc
>
> ~/.twmrc (or .tvtwm,fvwm,.mwm, .vtwm, tkwm, olwm, and olvwm)
> depending on the manager used. This is the file for the window
> manager. The most popular one is twm. I have fvwm2. This controls
> things like which menu options are available using the mouse, the
> background colour of a window, the size/colour of borders. It
> describes your windows environment. This is where you do most of the
> configuring and customizing.
>
> To make a change which permits use of a mouse in xemacs, you could add
> "Xemacs" and its geometry to the list of programs under `menu
> "Programs_menu"`.
>
> To change the size and location of one of the program menus, you can
> alter the geometry of that program in `/.twmrc.
>
> ~/.Xresources
> You can set general defaults which will govern X programs in general.
> By setting a general default for the type of fonts to be used by all
> program, you can simplify the settings required in .xinitrc or
> .xsession. You could set a font within Xmh for instance or indicate
> that all xterm windows should be supplied with scroll bars.
>
> If for some reason there is no .xinitrc or .xsession file, then startx
> or xdm will cause /usr/X11R6/lib/X11/xinit/xinitrc to initiate a
> reading of the ~/.Xresources file.
>
> ~/.Xdefaults
> Some distributions use .Xdefaults instead of .Xresources for user
> configurations. In Slackware .Xresources is used. This is a good
> place for a user to indicate that he wants scrollbars in all of his
> xterm windows. You can do this by adding the following line in your
> ~/.Xresources file:
> xterm*scrollBar:true
>
> If you find that the xterm scroll buffer is too small, you need to
> change ~/.Xresources :
>
> XTerm*SaveLines: 256
> or
> XTerm.SaveLines: 256
> Then you would have to run xrdb ~/.Xresources or exit and restart your
> X session.
>
> To assign fonts to an xterm window:
> xterm -fn <font_alias> ...
>
> To get a list of available fonts:
> cd /usr/lib/X11/fonts
> ls -lF
> You will see subdirectories in which you will find files called
> "fonts.alias". These will list the aliases of available fonts.
>
> To obtain a list of colors that can be used in your .Xresources:
> showrgb |more
>
> To obtain a list of colors that are reddish:
> showrgb | grep red | more>
> To change the shape of the cursor in X while using fvwm2:
> Add the following line to your .fvwm2rc file
> Exec xsetroot -cursor_name <name_of_desired_cursor>
>
> See the file /usr/X11/include/X11/cursorfont.h to pick a cursor style.
> It is also possible to use a bitmap with xsetroot.
>
> To set the DISPLAY environment variable in linux for a bash shell:
> export DISPLAY=206.239.36.102:0.0
> or
> set DISPLAY=206.239.36.102:0.0
>
> For a tcsh shell:
> setenv DISPLAY=206.239.36.102:0.0
>
> To display the current X font path:
> xset q
>
> To get the color version of the ls screen:
> Add the following to your .Xresources file:
> xterm.eightBitOutput: true
>
> To make both the backspace and the del key work on X:
> Put in your ~/.Xmodmap these two lines:
> keycode 22 = BackSpace
> keycode 107 = Delete
>
> You can obtain a "full screen browser" by setting
> your .Xresources file to turn off window manager decoration for your
> browser.
>
>
> 3. Starting X window
>
> Linux uses XF86 as its X window program. It supports single-user
> window interface as well as acting as a server that can be used by the
> user to open additonal screens or by other users.
> xinit can be used from the command line using the pattern:
> xinit <client_program> <client_program options>
> <--servername><display><display options>
>
> If you use this to skip the defaults which may be included in startx
> (see below), be sure to type xinit -Return only once. If you enter it
> a second time the system will choke.
> Example:
> xinit xterm -geometry 80x65+10+10 -fn 8x13 -j -fg white -bg
> navy -- /usr/X11R6/bin/XF86_SVGA :0
>
> (The results of this command will be to open XF86 with an
> xterm window with a certain size and location on the rootwindow
> (the desktop), using a certain font with white letters on a
> navy background. The X server is XF86_SVGA and the display will
> be created on the main console.)
>
> Sequence of events when xinit is called:
> IF A CLIENT IS NAMED ON THE COMMAND LINE:
> xinit begins the client which will control the session. When
> this client exits, the X session ends.
>
> If a client program is NOT named on the command line:
>
> xinit will check to see if a shell file ~/.xinitrc exists.
> This file must be readable and executable by the user.
>
> -- If ~/.xinitrc exists, the shell script will be
> executed. It first merges any user configurations plus default
> configurations. The first configuration file checked is
> ~/.Xresources. It is in this file that a user can set personal
> preferences for such things as fonts, scrollbars, emacs, netscape and
> other X programs.
>
> It then checks /usr/X11R6/lib/X11/xinit/.Xresources.
> This file contains the system's default settings.
>
> -- .xinitrc then checks for ~/.Xmodmap and if that does
> not exist, it merges the default keymap located in
> /usr/X11R6/lib/X11/xinit/.Xmodmap.
> The ~/.Xmodmap file is used to define keys--such as
> insuring that the backspace and delete keys perform as
> desired by the user in various programs.
>
> Using the configurations contained in the above files, xinitrc
> then starts any clients that are included in the .xinitrc file.
> All but one of the clients usually are run in the background.
> The last client listed is usually a window manager or a terminal
> emulator. It runs in the foreground and when it is exited by the
> user, the session ends. The .xinitrc file is the place where a
> user defines which clients he wants to automatically start, the
> size of windows, which fonts are used for them and which window
> manager or terminal emulator is started. The speed of the
> mouse in X can also be established in this file.
> You can go to a particular client and adjust its size and
> position to your satisfaction. You then query its current geometry
> with the xwininfo command (man xwininfo for details). Note down the
> geometry and then go to ~/.xinitrc and enter the name of the client
> and the geometry that you recorded for it.
>
>
>
> The xinitrc file can be very short. An example follows:
>
> #!/bin/sh
> # $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $
>
> ##The first thing that the startx reads in .xinitrc is a list of the
> default settings ##located in various files located in the user's home
> directory or in system default files ##of the XF86 program.
>
> userresources=$HOME/.Xresources
> usermodmap=$HOME/.Xmodmap
> sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
> sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap
> userdefaults=$HOME/.Xdefaults (Note comment above re .Xdefaults
> sometimes being used
> instead of .Xresources.)
>
> ##After the above files are scanned, the contents of them are merged
> and these are then ##used by the X window program.
>
> # merge in defaults and keymaps
> if [ -f $sysresources ]; then
> xrdb -merge $sysresources
> fi
> if [ -f $sysmodmap ]; then
> xmodmap $sysmodmap
> fi
> if [ -f $userresources ]; then
> xrdb -merge $userresources
> fi
> if [ -f $usermodmap ]; then
> xmodmap $usermodmap
> fi
> if [ -f $userdefaults ]; then
> xrdb $userdefaults
> fi
>
>
>
> ## The following commands will speed up the mouse in X:
> xset m 4 2 &
> or
> xset m 3 10 &
>
> # start some nice programs
> ## The following line sets the background color for the X window
> desktop to a solid dark ## blue. The trailing ampersand is to place
> this command in the background.
> xsetroot -solid SteelBlue &
>
> ## fvwm95-2 provides a clock so there is no need to add one here. If
> your manager does
> ## not provide a clock you could add:
> ## xclock -geometry 50x50 -1+1
> ## The above would place an xclock in the upper left corner of the
> screen.
>
> ## The following creates a console window which will avoid having
> console messages
> ## appearing on your screen and having to keep refreshing your screen.
> The -iconic will ## start the console window in a minimized condition.
> xconsole -iconic &
>
> ## The following creates a 59x34 xterm window in the upper right side
> of the desktop.
> xterm -geometry 59x34+7+7 &
>
> ## The following creates a second xterm window
> xterm -geometry 99x27+5+51 &
>
> ## Note the absence of an ampersand after the next command.
> exec fvwm95-2
>
> ##end of .xinitrc file
>
> Some additional possibilities for .xinitrc:
> You can provide additional options in your description of a window
> you wish to open. For instance, you might wish to have an xterm
> window with the following options:
> xterm -geometry 99x27+5+51 -T LoginXterm -n xterm.xbm -sb
> -sl256 -j -ls -fn 7x14&
> -T <name> The title that appears in the title bar of
> the XTerm window. In
> this case the tile will be LoginXterm
> -n <name> Identifies the icon to be used if the window
> is minimized.
> -sb : This provides a scrollbar
> -sl<number>: Specifies the number of scroll lines to
> saved to a buffer. The default is 64 lines.
> -j : Permits "jump" scrolling, which is much faster
> -ls : this is a login shell (if you use +ls instead,
> it is a normal subshell)
> -fn 7x14 : this identifies the font to be used.
> When the .xinitrc shell script exits, startx kills the server and
> performs a session shutdown.
> A user should have at least a window manager line for twm,
> fvwm, fvwm95 or another manager which is to the user's personal taste.
> There should also be one or more xterm windows, possibly a calendar, a
> spreadsheet and any other program that the user routinely wants
> launched. The key decision in configuring .xinitrc is to decide which
> program the user wishes to control the entire session. The choice is
> normally between one of the xterm windows and the window manager
> program. You specify your choice by placing it at the end of the list
> of programs to be run. This program is the only one that does not
> have a trailing ampersand (&) which causes the program that proceeds
> it to be run in the background. In the above case the controlling
> program is fvwm95-2 and when the fvwm window is exited the entire X
> window session is halted and the user is returned to the console
> prompt. If you reversed the position of the last xterm with that
> of fvwm2 and placed an ampersand after fvwm2 and removed the one
> trailing the xterm command, the xterm window would be the controllling
> program.
> You have noticed the use of the -geometry argument to specify
> the size and location of the xterm windows. It is in the .xinitrc
> file that you can make adjustments to personalize window placement to
> suit your own preferences.
>
> Geometry basics:
> The size and location of a window is specified by:
> <Name of program> -geometry <Width of Window><Heighth of
> Window> <Distance from left or right side of screen><Distance from Top
> or Bottom of Screen>
>
> An example: xterm -geometry 80x42+2+2
>
> This orders the creation of an xterm window which is 80columns
> wide and 42 lines long and positioned with the upper right hand corner
> of the newly created xterm window located at a point that is 2 columns
> in from the left side of the visible screen and 2 lines down from the
> top of the visible screen. If you wanted this same xterm window to
> appear in the upper right hand corner of the screen you would describe
> it as :
> 80x42-2+2 which means that it is located 2 columns from the
> right side of the screen (the - means right side) and 2 lines from the
> top of the screen (the + means from the top when it refers to the
> second of these numbers.
>
> To position the same window in the bottom left of the screen:
>
> 80x42+2-2 which means it is located 2 columns in from the
> right side of the screen and 2 lines from the bottom (-2).
>
> To position the same window in the bottom right of the screen:
> 80x42-2-2 which means it is located 2 columns from the right
> side of the screen and 2 lines from the bottom (-2) of the screen.
>
> To tweak these placements you can startx and when the new desktop
> and windows are displayed you can move the windows about and change
> their size using the mouse/cursor. When you are satisfied with the
> layout, you can click the left mouse button on the desktop (not within
> any of the xterm windows) and the current window settings will be
> displayed. You can note these figures and then edit the .xinitrc file
> to make them permanent. If the font selection is not to your taste
> you can use xfontsel to choose a better one and enter that information
> in the .xinitrc file as well.
>
> {}
>
> Use the xwininfo command to obtain details regarding current settings.
> When you enter the xwininfo command and press return you will
> be asked which window you wish to obtain info about. Use the
> mouse/cursor to select the window of interest. The results will be
> displayed in the window in which you entered the xwininfo command.
> You will note that the geometry is displayed in a slightly different
> format. As an
> example, if you selected the xterm window described aboe as being
> 80x40-2-2, the xwininfo report would describe it as -2-2 80x40. When
> you use that information in your .xinitrc file, you should switch it
> to 80x40-2-2.
> The actual appearance of the windows, menus and buttons that are
> launched via the .xinitrc file are subject to the configuration
> instructions contained within the windowmanager configuration file.
> Copies of a basic xinitrc file are usually located in
> /usr/X11R6/lib/X11/xinit/xinitrc and in /var/X11R6/lib/xinit/xinitrc.
> Note that these files do not have a leading period. If you use them
> as a basis for your own personalized .xinitrc file, you must copy them
> to your home directory as :
> cp xinitrc ~/.xinitrc (adding the "." )
>
> This file needs to be executable so you may need to type:
> # To move to your home directory:
> cd
> # To make the new "dotfile" visible:
>
> ls -a
>
> # To make it executable:
>
> chmod 755 .xinitrc
> or
> chomod ug +x .xinitrc
>
> # Note: The .xinitrc script will run if you type either startx or
> xinit.
>
> TROUBLE SHOOTING NOTE: If you corrupt your .xinitrc file while
> editting it,you may find that you are prevented from logging into X
> windows. If this occurs there is a way in which you are permitted to
> enter and correct the file.
> You normally login by entering your user's name and a password
> and then pressing Enter. If you find that you can not login this way,
> you should try:
> Enter your user name and press return.
> Enter your password and instead of pressing return, press the
> F1 key. This opens a single xterm window and allows your to open your
> .xinitrc file for editing. After you
> make your corrections you can attempt a normal login.
>
>
> A fuller description of the .Xresources and .Xmodmap files is
> given below.
>
> IF A CLIENT IS NOT NAMED ON THE COMMAND LINE:
>
> xinit will open a default set of clients, which may include
> a clock, some xterms and a
> window manager.
> -------------------------------------------------------------------------------------------------------------
>
>
>
>
> Your X server needs to either be suid root or run as root. xdm runs
> as root, and so can start the X server without problems. startx runs
> as the user who invoked it, and so can't start the X server unless
> said user is root. If you really want to use startx, then (as root)
> figure out which X server you're using (i.e. XF86_SVGA), and then
>
> hostname# cd /usr/X11R6/bin
> hostname# chmod +s XF86_SVGA
>
> to set the suid bit and always run the program as root.
>
>
>
>
> -------------------------------------------------------------------------------------------------------
>
>
>
> Try `:0 local /usr/X11R6/bin/X -bpp 16' in /etc/X11/xdm/Xservers.
>
> The /usr/X11R6/bin/X file is a link to the X server. Both startx and
> xdm therefor have this same route to the X server. The distinctive
> difference between the two is that xdm provides the login feature.
> xdm can provide a means of placing a background pattern or picture on
> the login screen. This can be done by altering the file Xsetup.
> To place a picture, you will need to employ a client that can handle
> graphics. One such client is xv.
> You can employ a line like:
> xv -quit -rmode 4 -root <picture>
> or
> xv -root -rmode 5 -quit /*.jpg
> or /*.gif
>
> When you use a picture, you need to kill it before a user logs in.
> The user would be unable to get rid of the picture. You can do this
> by placing a killall command in the file Xstartup or GiveConsole.
>
> killall xclock
> Once you log in, xdm runs the .xsession script and then runs Xreset so
> that another user can log on in the same manner.
> xdm can be terminated by CTRL-ALT-F6 which brings up a command line.
> Then use CTRL-ALT-DELETE to leave Linux.
> Please remember that .xinitrc and .xsession are identical in content
> and linked. The results of using either path are identical for all
> practical purposes.
>
> Unlike startx, which can be killed with ctrl-alt-backspace, when you
> do a ctrl-alt-backspace using xdm you only kill the X server.
> xdm is acting as a login service and will die only on shutdown. Not
> so, ^R will switch you to your virtual console
> CTRL-ALT-F6 (or CTRL-ALT-F1) takes you to a non-X screen. Then
> CTRL-ALT-DEL does the shutdown.You can shutdown from within X with:
> /sbin/shutdown -R 0 (zero not the letter o)
>
>
> -------------------------------------------------------------------------------------------------------
> SETTING X WINDOW DEFAULTS
>
> Each application has a file which has its default settings. These
> are located in:
> /usr/X11R6/lib/X11/app-defaults/
> Each application is represented by a file in this directory, usually
> bearing the name of the application. When X window is started with
> startx or xdm, the .xinitrc and .xsession files are read respectively.
> Both of these files begin with a command to xrdb (the xresource
> database utility) to merge the contents of four configuration files
> (if they exist) into the resource database to be used by the clients.
>
>
>
> For large fonts in xterm:
>
> Control-Right-click on an xterm.
> Or find a font name you like and put that in your X resources. It
> needs to be a "c" or "m" - spaced font, xterm doesn't cope with
> proportional fonts.
>
> -------------------------------------------------------------------------------------------------------
> XF86 MANAGEMENT:
>
>
> If you have a copy of XF86 already installed, you can determine which
> version by using the command:
> X -showconfig
>
> When you have installed XF86 you can configure it with two different
> commands.
> XF86Setup
> or
> xf86config (note the use of lowercase)
>
> After you have completed the configuration and have opened your first
> X session, you can adjust the video settings by using the xvidtune
> utility.
>
>
>
> -------------------------------------------------------------------------------------------------------
> TROUBLESHOOTING IN X
>
> Getting a log of your startx startup:
> When starting x, you can:
> startx 2>x.error
> then, if you want to view the messages as they scroll past,
> tail -f x.error
> which works from any tty device, including an xterm.
>
> To see what XF86 is doing when it starts, you can create a one-time
> logfile which you can then read.
>
> X > /tmp/x.out 2>&1
> less /tmp/x.out
>
> or
> X -probeonly >/tmp/x.out 2&1
> less /tmp/x.out
>
> Note: If you have a clockline in the Devices Section of
> /etc/F86Config (see below for more details regarding this
> configuration file), you should comment them out with #s before your
> perform the probe. Unless this is done the probe will just repeat the
> clockline settings in /etc/XF86Config rather than making an actual
> probe. When you have finished the probe, delete the #s.
>
>
> If you get an error when trying to start that says, "can't open
> display", try:
> export DISPLAY=:0 from the command line.
> If that solves the problem then edit your /etc/profile
> file and add the following line:
> export DISPLAY=:0
> This will be read at bootup.
> If you use xdm and find that you have made an error in your .xsession
> file that puts your system in a loop that keeps asking for a login,
> you can try Control-Alt-F6 to get another console login prompt. If F6
> does not work try F3, F4, Fx until you get another
> useable console. Login as root and fix your .xsession file.
>
>
> It's an environment problem. If you start an xterm or rxvt without the
> -e switch,
> it will run bash, which will source your ~/.bashrc, which will set
> LYX_DIR. If
> you use the -e switch, it will run the command using the environment
> inherited
> from the window manager, which presumably doesn't include a setting
> for
> LYX_DIR.
>
> It's generally a good idea to have your X initialisation (e.g.
> ~/.xsession or
> ~/.xinitrc or whatever) source your startup files (/etc/profile,
> ~/.bash_* etc).
> Then this problem doesn't arise.
>
>
>
> USEFUL COMMANDS:
>
> How to switch X to normal term and back.
> Use: "Alt-F7". The X screen takes up the next available tty,
> which
> on most default setups, should be #7.
>
> Assuming you start X on the first console..press
> CTRL-ALT-F[2/3/4/5/6] to
> switch to ANY of the other text consoles..and once there..you can use
> the
> regular ALT-F[1/2/3/4/5/6] sequence to switch between the text
> consoles..
> if you wish to get back into X again..press CTRL-ALT-F7 and you should
> be back in X again.
>
> xvidtune : described above
> xwininfo : described above
> xlsfonts : provides a list of fonts
> xfontsel : searches font lists based on user specified
> arguments and displays fonts which are known to your
> server.
> As root:
> xfontsel &
>
> xfd : displays fonts.
> To preview a font:
> xfd -fn <fontname>&
>
>
> xrdb :updates the resource database.
> xrdb .Xresources
>
>
>
> The following re a problem getting an MS Intellimouse
> to work in X:
> Subject: Re: X on slackware 3.5
>
> Thanx for all the help. After I look closely to both
> gpm and XF86Config file, I found that they use different
> protocols for my MS Intellimouse. gpm uses imps2, while
> XF86Config uses IntelliMouse. So, I changed the protocol
> in XF86Config to IMPS/2, and everything works. I don't
> even have to disable gpm!!! Hope this info will help
> the others who have the same problem.
>
>
> .xinitrc and .xsession must be executable; do chmod +x .xsession
> chmod +x .xinitrc
>
>
> >How do I change the font size of an Xterm session ???
>
> Press the Ctrl key and the right mouse button at the same time
> with the cursor in the window. You should get a menu of fonts
> to choose from.
>
>
> > how can i change the title of an xterm from with in that xterm
> > i remember it can be done thru
> >
> > $ echo -e "some control characters"
> >
> > but exact command i forgot
>
> Try adding the following to your ~/.bashrc (or similar):
>
> function settitle
> {
> title="`whoami`@`hostname`:`pwd`"
> echo -ne "\033]2;$title\007"
> }
>
> case $TERM in
> xterm)
> PROMPT_COMMAND=settitle
> ;;
> esac
>
> --
> Glynn Clements <glynn@sensei.co.uk>
>
> To change the title of an xterm:
> echo -ne "\033]2;type_your_title_here\007"
> ===
> > By the way how can I exit xdm. In xdm when I exit the W.M. I have to
> > login to xdm again. With CTRL-ALT-BACKSPACE the same thing happens.
>
> Press Ctrl-R at the login screen to kill xdm.
>
> --
> Glynn Clements <glynn@sensei.co.uk>
>
>
>
>
>
> Regards,
> jmpaden@mnsinc.com
> "The last temptation is the greatest treason:
> To do the right deed for the wrong reason."
> --T.S. Eliot
>
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9906190928140.344-100000>
