![]() (Using an ~/.Xdefaults file does not load the resources into the server, but reads them upon startup of each X application, so xrdb -query -all returns nothing.)Ģ years, 6 months Oh, I think the per-application reading of. ![]() So the syntax is correct, but the X toolkit's automated system seems to be mishandling the #define or the second #include. But with the original ~/.Xdefaults in place, only bare xterm does. xrdb -query only includes user-defined resources, appres also takes system defaults into account.Ĭuriously, running cpp ~/.Xdefaults > cpp_out mv ~/.Xdefaults ~/.save.Xdefaults mv cpp_out ~/.Xdefaults makes both xterm and uxterm work. If xrdb -query looks right, check with appres to see what resources are applied to a particular class and optionally instance. Also, if resources aren't having effect, review the output of xrdb -query to check whether the problem is that they aren't set as desired or that they don't have the desired effect. Not sure how to debug whether the #define or the second #include is failing.Ģ years, 6 months Start by running cpp ~/.Xdefaults | less and reviewing the output. The first #include is clearly working, per (a). Xdefaults applied to xterm or uxterm as appropriate (c) resources set in xterm-common file not applied to uxterm. :-/ My result: (a) resources set in xterm-common file applied to xterm (b) resources set in. I love the preprocessor trick! I only wish it worked. I have code to apply some resources for both XTerm and UXTerm: define(`XTERM_class_settings', ` This means that I can't rely on the default loading of ~/.Xresources: I call xrdb -cpp m4 ~/path/to/my/Xresources explicitly from my. #include ".config/x11/xterm-common-Xresources" Xresources file, include xterm-common.Xresources twice, once for each class name. Put the common definitions for XTerm and UXTerm in a separate file xterm-common.Xresources. However, you can solve your problem with cpp using include files. In particular, you can't have a line break in the expansion of a cpp macro, so you can't define a macro to expand to multiple X resources. Unfortunately, cpp is not very convenient for the X resource syntax. xrdb (the utility that loads X resources) uses the C preprocessor ( cpp) by default. The solution is to rely on the preprocessor. *XTerm means “ XTerm at any level of the hierarchy”, not “any name that ends with XTerm”. Wildcards match components, not individual characters inside components. In general, you can't do this with the basic X resource syntax alone. ![]() In this specific case, you could perhaps use ?.VT100.background: Blackīecause in practice, xterm is the only application with a VT100 widget. You can get two tiers of configuration this way, but if you want three tiers, this won't help. With these definitions, xterm -name light has a white background and has scroll bars. If you want to have multiple XTerm configurations and choose one at invocation time, you can use a single class and multiple instance names: : Black If you eliminate the class name, using just *scrollBar:true, that would apply to both xterm and uxterm (as well as any other application using that resource name). It's more like an ellipsis ".", replacing zero or more levels of the widget hierarchy. Wildcarding doesn't work in X resources as you might use glob expressions in a shell. Is there a way to make certain resources apply to both programs (which are really the same program underneath anyway), while retaining the ability to have other resources apply specifically to one or the other (which rules out, say, always starting xterm via xterm -class UXTerm)? Thanks for any ideas. Wildcarding the class name, for instance, will not pick up both of them: ! This works for xterm but not uxterm In order to apply the same resource to both xterm and uxterm, currently my configuration file has to have separate, duplicate entries: XTerm*scrollBar: true Top make resource apply to both classes XTerm and UXTerm Make resource apply to both classes XTerm and UXTerm
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |