132 The X-Windows Disaster Myth: X Is “Customizable” …And so is a molten blob of pig iron. But it’s getting better at least now you don’t have to use your bare hands. Hewlett-Packard’s Visual User Environment is so cutting-edge that it even has an icon you can click on to bring up the resource manager: it pops up a vi on your .Xdefaults file! Quite a labor-saving contraption, as long as you’re omniscient enough to understand X defaults and archaic enough to use vi. The following message describes the awesome flexibility and unbounded freedom of expression that X defaults fail to provide. Date: Fri, 22 Feb 91 08:17:14 -0800 From: beldar@mips.com (Gardner Cohen) I guess josh just sent you mail about .Xdefaults. I’m interested in the answer as well. How do X programs handle defaults? Do they all roll their own? If they’re Xt, they follow some semblance of standards, and you can walk the widget tree of a running application to find out what there is to modify. If they’re not Xt, they can do any damn thing they want. They can XGetDefault, which doesn’t look at any class names and doesn’t notice command line -xrm things. Figuring out where a particular resource value is for a running appli- cation is much fun, as resource can come from any of the following (there is a specified order for this, which has changed from R2 to R3 to R4): .Xdefaults (only if they didn’t xrdb something) Command line -xrm ’thing.resource: value’ xrdb, which the user runs in .xsession or .xinitrc this program runs cpp on the supplied filename argument, so any old junk may have been #included from another planet. Oh, and it #defines COLOR and a few other things as appropriate, so you better know what kind of display it’s running on. Filename, pointed to by XENVIRONMENT .Xdefaults-hostname Filename that’s the class name of the application (usually com- pletely nonintuitively generated: XParty for xparty, Mwm for mwm, XRn for xrn, etc.) in the directory /usr/lib/X11/app-defaults (or the
X Myths 133 directory pointed to by the XAPPLRESDIR environment variable). The default for this directory may have been changed by whoever built and installed the x libraries. Or, the truly inventive program may actively seek out and merge resource databases from other happy places. The Motifified xrn posted recently had a retarded resource editor that drops modified resources in files in the current directory as well as in the user’s home. On startup, it happily looks all over the place for amusing- looking file names to load, many of them starting with dots so they won’t ‘bother’ you when you list your files. Or, writers of WCL-based applications can load resource files that actually generate new widgets with names specified in those (or other) resource files. What this means is that the smarter-than-the-average-bear user who actually managed to figure out that snot.goddamn.stupid.widget.fontList: micro is the resource to change the font in his snot application, could be unable to figure out where to put it. Joe sitting in the next cubicle over will say, “just put it in your .Xdefaults,” but if Joe happens to have copied Fred’s .xsession, he does an xrdb .xresources, so .Xdefaults never gets read. Joe either doesn’t xrdb, or was told by someone once to xrdb .Xdefaults. He wonders why when he edits .Xdefaults, the changes don’t happen until he ‘logs out,’ since he never reran xrdb to reload the resources. Oh, and when he uses the NCD from home, things act ‘different,’ and he doesn’t know why. “It’s just different sometimes.” Pat Clueless has figured out that XAPPLRESDIR is the way to go, as it allows separate files for each application. But Pat doesn’t know what the class name for this thing is. Pat knows that the copy of the executable is called snot, but when Pat adds a file Snot or XSnot or Xsnot, nothing happens. Pat has a man page that forgot to mention the application class name, and always describes resources starting with ‘*’, which is no help. Pat asks Gardner, who fires up emacs on the executable, and searches for (case insensitive) snot, and finds a few SNot strings, and suggests that. It works, hooray. Gardner figures Pat can even use SNot*fontList: micro to change all the fonts in the application, but finds that a few widgets don’t get that font for some reason. Someone points out that there is a line in Pat’s
Previous Page Next Page