Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpcc05!hpsciz!masa From: masa@hpsciz.sc.hp.com (Masayoshi Habu) Newsgroups: comp.windows.x.motif Subject: Re: Conditional Resources Message-ID: <13270008@hpsciz.sc.hp.com> Date: 9 Apr 91 17:48:25 GMT References: <14234@hacgate.UUCP> Organization: Hewlett-Packard, Santa Clara, CA Lines: 23 In comp.windows.x.motif, sean@mitchell.eos.scg.hac.com (Sean Cohan) writes: > Is it possible to specify in the app-defaults file a conditional if > statement? I want my x, y, width, and height values to be one set of > values if the display is a Sun 19" monitor, and I want them to be > another set of values if the display is a Mac 14" monitor. Nice if we could. But there is another solution for this. Your X server is usually invoked from a start up script which is called .xinitrc or something like that in your home directly. In this script, you can load resources into your X server by xrdb command. This script is no more than a simple shell script, so you have control scructures like 'if'. Resources loaded to X server by xrdb take precedence over app-defaults. Please note that xrdb can pass your resource file through cpp, so you have another place where control structure like '#ifdef' is available. I setup .Xresources file in my home directory and let xrdb read this file as well as .Xdefaults. My .Xresources file has a bunch of cpp directives to select the right fonts and colros for various displays from B&W 16" to 8-plane color 19". Masa Habu