[Techtalk] rxvt - was: Re: End key no longer goes to EOL

Mary Gardiner linuxchix at puzzling.org
Wed Jan 16 23:39:24 EST 2002

On Wed, Jan 16, 2002 at 08:24:20AM +0000, Telsa Gwynne wrote:
> On Tue, Jan 15, 2002 at 08:59:13AM -0800 or thereabouts, Laurel Fan wrote:
> >   image/jpeg; display '%s'; test=test -n "$DISPLAY"
> Laurel, you are a star. 


> This works much more nicely. What's the
> "-n" flag for "test" doing? 

Testing if the DISPLAY variable is set (or rather, that it's length is
non-zero). Testing the DISPLAY variable is a nice sneaky way of testing
"am I in an X session?"

If the test fails by the way, the mailcap will proceed to the next one,
so I have

text/html; /usr/bin/galeon '%s'; description=HTML Text; nametemplate=%s.html;test=test -n "$DISPLAY"
text/html; /usr/bin/links '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html

so it will only use Galeon when in X and links otherwise (this also has
the nice effect that when combined with 'auto_view text/html' in my
.muttrc, it will use links to dump the HTML to text, lynx can do the
same thing).

I HEART mailcap.


Mary Gardiner
<mary at puzzling.org>

More information about the Techtalk mailing list