7.4. Resource Customisation   

The file specified by the XENVIRONMENT variable is read by every X application which starts up and is therefore a very important part of the X system. The following framed examples show parts of the (standard SGI) .Xdefaults file.

The first part shows the way in which typical resources( colour, fonts, geometries can be set for various programs as run (xwsh) or as Classes (XWsh). For example, all Window Shells on SGs run the program xwsh and have a Class name of XWsh. Therefore all Window Shells will have the resources specified by the XWsh resource Class name. It is possible to run a Window Shell with the "-name xxxx" flag which will set its name to xxxx. This would then be used to lookup extra resources of the form:
xxxx*background: #00466a

The application would then inherit the Class resources and overide those specified by the above Instance resources.

    !  Define some customizations for xwsh

xwsh*background: #00466a
xwsh*foreground: grey80
xwsh*cursorTextColor: white
xwsh*cursorPageColor: red
xwsh*barPointerShape: spider
XWsh*clientDecoration: +minimize +maximize +menu +border
XWsh*autoFork: on
XWsh*selectionTextColor: white
XWsh*selectionPageColor: 163
XWsh*geometry: 80x24
XWsh*font: -*-lucidatypewriter-medium-r-normal-*-14-140-*
XWsh*OverFirst: true
:
:

Also, the ".Xdefaults" file is used to set Window Manager resources:

    !              4Dwm settings

! These resources apply to icon management
4Dwm*iconPlacement: top left
4DWm*iconDecoration: image
4Dwm*iconImageMaximum: 64x77
4Dwm*icon*fontList: -*-courier-bold-r-normal-*-12-*
4Dwm*iconPlacementMargin: 0
4Dwm*useIconBox: False
4Dwm*iconbox*clientDecoration: none
4DWm*clientAutoPlace: false
! define the icon tiling area with the following 4 boundary edges:
4DWm*SG_iconPlacementLeftMargin: 90
4DWm*SG_iconPlacementRightMargin: 280
4DWm*SG_iconPlacementBottomMargin: 678
4DWm*SG_iconPlacementTopMargin: 768
! Set the foreground color (which is the text) for the client window title bar that currently has the input focus.
4Dwm*activeForeground: gold
! Set the background color (the title bar itself which is "behind the text") for the client window title bar that
! currently has the input focus.
4Dwm*activeBackground: deepskyblue4
:
:

The following examples show ".Xdefaults" use for setting the look of various programs (clients). Note the line "*clientDecoration:" which sets the default look for all clients. It is useful to specify the geometry as well - placement of the windows on your screen.

Note that with geometry specifications it is widthxheight xpos ypos. The width and height are optional and either specify pixel values or may for certian clients specify character values (i.e. 80x24 is typical for an xterm geometry resource. The position information is pixel based and the is used to specify where the window origin is placed. The topleft hand corner is +0+0, the top right hand corner is -0+0, etc. The appropriate corner of the window frame is chosen for the geometry placement. The specification is used so that the exact display size need not be known to place windows on either side.

Any resource may be specified for an X client given the appropriate hierarchy (i.e. "irit*Trans*BackGround:"

Note that the key, button and menu specifications indicate what 4Dwm resource to use to set the bindings to keys, etc. These are specified in another file .4Dwmrc

    !  The following resources define what the 4Dwm frames will look like for specific clients.

! The values explicitly listed specify various elements of the window manager frame.
! Specifying a "+" means "add this element", while no other frame elements are drawn;
! "-" means "subract this element" but otherwise leave other elements untouched;
! "none" means paint no window manager frame at all.
4Dwm*xterm*clientDecoration: +resize +minimize
4Dwm*xeyes*clientDecoration: +title
4Dwm*xbiff*clientDecoration: +border
4Dwm*xclock*clientDecoration: none
4Dwm*Xman*clientDecoration: -menu -maximize
! make all apps not explicitly defined above have the following client decoration resources turned on.
*clientDecoration: +resizeh +border +minimize +maximize +menu
! paint ipaste images without any border (use Meta or rightShift-RightControl
! -RIGHTMOUSE to get 4Dwm menu).
*ipaste*clientDecoration: none
*xarchie*clientDecoration: none
*xfig*clientDecoration: none
*xfig.geometry: 1024x768+0+0
*xmailtool*clientDecoration: none
*xmailtool.geometry: 666x764-0+0
irit*Trans*BackGround: NavyBlue
irit*Trans*Geometry: =150x500+500+0
irit*Trans*CursorColor: Green
irit*View*BackGround: NavyBlue
irit*View*BorderColor: Red
irit*View*BorderWidth: 3
irit*View*Geometry: =500x500+0+0
irit*View*CursorColor: Red
! These define key, button and window menu specifications for 4Dwm.
! The values given to these resources must be defined in $HOME/.4Dwmrc
4Dwm*keyBindings: myKeyBindings
4Dwm*buttonBindings: myButtonBindings
4Dwm*windowMenu: 4DwmWindowMenu

As mentioned in the discussion of the ".xsession" file, it is usual to separate the ".Xdefaults" resource specifications into a number of different files representing display sizes. The typical resources which change are geometry placement, and font sizes but need not be limited to those.