Making the Most of Andrew
All AUIS applications provide a means to use a filter to modify a selected area. The Misc menu card provides items to fold data to lower case, upper case or to “flow” the data together. To use filters, simply select an area (so it is highlighted) and select the correct item. There is also an item (Filter Prompt) which allows you to specify your own filter. For instance, specifying the filter sort would cause the selected text to be sorted—just like you would in a conventional Unix pipe.
You can tailor the behavior and appearance of your AUIS applications with your own ~/preferences file. Each time an application begins, it checks a set of resources you have specified in your preferences file. The resources in the preferences file are similar to other X-resources. A sample preferences file is provided in /usr/andrew/sample.preference. If you edit this file you will find lines like these:
Messages.Geometry: 750x600 Figure.BackgroundColor: White *.BackgroundColor: LightSkyBlue4
The first field (e.g., Messages, Figure or “*”) is the application name. The asterisk means it applies to all AUIS applications. AUIS resource names are case insensitive, so “Messages” is the same as “messages”. The second field is specific to the application. Most of these, like “Geometry” or “BackgroundColor”, will be pretty obvious. Others, like “XStyleSelections”, will be a mystery unless you read the preferences help file (auishelp preferences). Some of these resources are specific to a single application and others apply to all AUIS applications.
The third field (after the colon) is the value of the resource and is tied directly to the second field. These resources can be rather confusing. To make it easier to understand what resources can be set for which applications, a specialized preferences editor was written, prefed. As you can see in Figure 5, the prefed window is divided into four areas. You select the application name in the upper left hand window (“EZ” in this case). The upper right hand window has the list of resource names (“OverwriteFiles”). The middle window shows you what the current setting is and allows you to change it. Finally, the bottom window provides a description of what the resource controls. When you select the item Save, your preferences file will be modified, just as you would expect with any editor. The addition of prefed has made it much easier to figure out this bewildering array of resource names. When an application initializes, it searches for all resources that apply to that application. The resources are applied in the order that they are read. The search order is first in ~/preferences and then in the machine-wide “preferences” file in /usr/andrew/lib/global.prf. Thus, if you specify any resources that apply against all applications (e.g., *.BackgroundColor), these should be at the bottom of your preferences file. This is sightly different than resources for conventional X-applications.
One thing to keep in mind is that preferences are only read when an application initializes. If you change the ez BackgroundColor, for example, this will not take effect until you start a new ez from the command line (from an xterm or typescript).
Messages, the multi-media mail user agent, is unique with respect to its treatment of preferences. Since there are a great many preferences resources for messages, a long time ago the author of messages added his own specialized way to set preferences for messages by selecting the Set Options item on the Other menu card.
Printing is an area where it seems everyone needs to “have their own way”. AUIS printing involves two steps. Applications generate groff data and the first step is to format this to generate the printer-specific datastream. The second step is to simply deliver the stream to the printer. These two steps can be overridden with your preferences. The default preferences settings are:
*.FormatCommand: /usr/andrew/etc/atkprint /tmp/%s.n | *.PrintCommand: lpr -P$PRINTER
These two commands are joined in a pipeline (hence the pipe character, “|”, at the end of FormatCommand). When this command is built, the %s will be changed to the name of the groff input file.
Many AUIS applications actually generate PostScript data with just a simple groff “wrapper” around the PostScript. In the next major release, AUIS will generate PostScript directly and the need for a FormatCommand will be eliminated. But for now, if you are having difficulty you might want to copy /usr/andrew/etc/atkprint and make your own version which you can modify to meet your needs. You can then specify your own FormatCommand resource to invoke your own version of atkprint.
Sometimes I want to capture the groff input, so I simply make a quick preferences change
*.FormatCommand: cat /tmp/%s.n > /tmp/test.n
to copy in the input file to /tmp/test.n. I can then execute the print sequence manually with:
/tmp/atkprint /tmp/test.n | pipescript
so I can see exactly what's happening in the shell script. On the other end, if I want to simply capture the PostScript, I can change preferences to:
*.PrintCommand: cat > /tmp/test.ps
There are obviously many ways to accomplish either of these steps. The point to remember is that AUIS printing is entirely externalized. You can control it to any degree you need.
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems
Join editor Bill Childers and Bit9's Paul Riegle on April 27 at 12pm Central to learn how to keep your Linux systems secure.
Free to Linux Journal readers.Register Now!
- Python Scripts as a Replacement for Bash Utility Scripts
- Considering Legacy UNIX/Linux Issues
- [<Megashare>] Watch Mrs Brown's Boys Movie Online Full Movie HD 2014
- Cluetrain at Fifteen
- Memory Ordering in Modern Microprocessors, Part I
- New Products
- Getting Good Vibrations with Linux
- Security Hardening with Ansible
- RSS Feeds
- diff -u: What's New in Kernel Development