"Xterm" or "xterm" in configuration file
X11 resources have a name which consists of a series of components separated by a dot, such as xterm.vt100.geometry
. The first component is the name of the application, the second component is a widget in that application, and the last component is a property of the widget. Widgets can be nested, so there can be more than three components, or just two for a property of the application.
Specifications of X resources can apply to a single resource or to a set of resources matching a pattern. There are two ways to make a specification apply to multiple resources.
You can use a class name instead of an instance name for any component. Conventionally, instance names start with a lowercase letter while class names start with a capital letter.
- At the application level, the class name is usually fixed for a given application, typically to the capitalized application name, and sometimes other letters are also in uppercase, e.g.
XTerm
,XCalc
,GV
,NetHack
, ... Applications using the X toolkit support an option-class
to set the class name, as well-name
to set the instance name (which defaults to the base name of the executable). For exampleXTerm.vt100.geometry
sets a value of thegeometry
property for thevt100
widget of any instance of theXTerm
class; it applies toxterm -name foo
but not toxterm -class Foo
. - At the widget level, there can be multiple widgets with the same class, for example multiple buttons in the same window. Xterm has a single widget of class
VT100
, calledvt100
, which is the terminal emulator part that covers the whole window. Other widgets include the menusmainMenu
,fontMenu
andvtMenu
of classSimpleMenu
.
- At the application level, the class name is usually fixed for a given application, typically to the capitalized application name, and sometimes other letters are also in uppercase, e.g.
- There are wildcards:
?
means “any widget”, and*
means “any widget sequence”. For examplexterm*background
defines a background for absolutely everything inside the Xterm window.
You can explore the resource tree of an application that supports the editres protocol with editres
. Few applications support this protocol, but Xterm is one of them.
It's possible for a given resource to be matched by multiple patterns. In this case, precedence rules apply. See the manual for the full rules.
In your case, it's likely that there's another entry somewhere that is a closer match for xterm.vt100.geometry
than xterm*VT100.geometry
, and that match is overriding your setting. The others have no other setting so whatever you do wins.
Some of the comments, etc., are not accurate. By the way, the description of X resources is in the X(7) manual page, in the section titled Resources. That's the best place to start reading, and there's little point in repeating it here.
Here's some points overlooked:
- resource names are case-sensitive:
XTerm
is not the same asXterm
is not the same asxterm
, etc. - conventionally X resource names use a leading capital letter for class name.
- when the first letter of the class name is
X
, there's a convention to make the second letter capitalized. So we getXTerm
. Other examples includeXCalc
,XClock
,XConsole
,XLoad
,XLogo
. - on the other hand, we have
Xedit
(lowercasee
),Xfd
,Xmag
,Xman
,Xmessage
,Xvidtune
. So the convention is not a rule. - X Toolkit applications (such as
xterm
) useXtOpenApplication
orXtAppInitialize
to initialize their application-resources. Those calls take an instance and class name. - conventionally, the instance name is the actual name of the program (its filename). If you happen to rename the program (as happens occasionally, e.g.,
xterm.real
) that changes the name. The program doesn't have to do this, but it's done often.xterm
does it. - usually the class name is a constant. It is not in
xterm
, because it expects one of two classes:XTerm
orUXTerm
(3 leading capitals). The latter is used for theuxterm
script, simplifying the way the fonts are specified. This dates from 2000, making it about midway in X's history. A quick check of the 30 programs in the X source tree from the early/mid-2000's which useXtAppInitialize
doesn't show any other programs using a variable for the class name. - the
-class
option is xterm-specific. Actuallydbedizzy
accepts a-class
option, for the visual class. That's different. X Toolkit has no such option. There's a list of the common options for X Toolkit in the X(7) manual page in Options. The xterm manual presents those in more detail, in X Toolkit Options. editres
, as its manual page indicates, works for any program using the X Toolkit. There's 36 programs in the X source-tree using one or the other of the two initialization calls mentioned, so it's not "few programs" to which this would apply.- on the other hand,
xterm
is one of the few for whicheditres
is not very useful. It has too many resource settings.
The app-defaults files which are installed for xterm
and other applications conventionally specify their resource-settings beginning with asterisk (*
). That makes them independent of the instance name. An asterisk matches any number of levels of the widget hierarchy, which is often a source of confusion, e.g., the xterm FAQ Why are the menus tiny?, where it is possible for a geometry resource intended for the VT100
widget to be (mis)applied to the menus. There are similar problems with too-generous matching applied to the font
resource. The fix for both is to use more-specific matches, referring to the VT100
widget (specific), using dot (.
), etc.
Because the app-defaults files avoid unnecessary use of '.'
, they are relatively easy to override in your own configuration. If you have trouble getting a resource such as
xterm*VT100.geometry: 100.80
to apply, there's only a few places to look:
- if you used that pattern before, it's already used, and setting it again (later in your resource-files) will not affect the value used.
- a more-specific setting such as
xterm.VT100.geometry
overrides less-specific ones using wildcards*
and?
.