Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bellcore!jello!aw From: aw@jello.bae.bellcore.com (Andrew Wason) Newsgroups: comp.windows.x Subject: Re: xrdb Message-ID: <1991Apr11.231801.5825@bellcore.bellcore.com> Date: 11 Apr 91 23:18:01 GMT References: <14315@hacgate.UUCP> Sender: usenet@bellcore.bellcore.com (Poster of News) Reply-To: aw@bae.bellcore.com Distribution: na Organization: Bell Communications Research Lines: 54 In article <14315@hacgate.UUCP>, sean@hazel.eos.scg.hac.com writes: >If I want to run a client on a Sun and a Mac, and be able to have seperate >width, height, and font resources for both machines, how do I go about >specifying this with xrdb? Is it based on the current DISPLAY value? What >if they specify the display value on the command line of an application? It is based on the server xrdb used when it was run. >How does xrdb know when to use resources speicified for the Mac and resources >speicified for the Sun? xrdb runs its input through cpp. It also defines some symbols based on the server it was run on. These are HOST, WIDTH, HEIGHT, X_RESOLUTION, Y_RESOLUTION, PLANES, BITS_PER_RGB, CLASS and COLOR (see xrdb(1) for explanations of these). So you can have one file which you can set up to work correctly for certain types of servers by #ifdefing chunks of resources. For example, in the resources I feed to xrdb, I put an '#ifdef COLOR' around all color resources. So when I run xrdb on my color server, I get all my color resources. But when I run xrdb on my monochrome server, no color resources are loaded and so everything defaults correctly. e.g. #ifdef COLOR XBiff*background: gray XBiff*foreground: yellow #endif XBiff*update: 5 XBiff*volume: 15 You could also use the WIDTH and HEIGHT symbols to conditionally include geometry resources depending on the size of your screen e.g.: #if WIDTH > 1000 XBiff.width: 512 #else XBiff.width: 256 #endif Type 'xrdb -symbols' to see the symbols defined for a particular server. Type 'xrdb -query' to see the resources xrdb actually loaded. Andrew _______________________________________________________________________________ Andrew Wason Bell Communications Research aw@bae.bellcore.com Piscataway, NJ bellcore!bae!aw