groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] groffview shell script


From: Bernd Warken
Subject: Re: [Groff] groffview shell script
Date: Wed, 28 Nov 2001 15:23:21 +0100
User-agent: Mutt/1.2.5i

On Wed, Nov 28, 2001 at 10:55:23AM +0000, Ralph Corderoy wrote:
> 
> Hi Bernd,
> 
> > In a later version, there should be an automatic detection if X75 or
> > X100 is better.
> 
> Here's a first stab.
> 
>     xset q |
>     awk '
>         BEGIN {
>             FS = "/"
>             f = "75dpi"
>         }
>         {
>             for (i = 1; i <= NF; i++) {
>                 if ($i ~ /^(75|100)dpi$/) {
>                     f = $i
>                     exit
>                 }
>             }
>         }
>         END {
>             print f
>         }
>     '
> 
Good idea, thank you :-)  Tho the xset output might not be reliable 
everywhere it is a good starting point.  But I would shorten it to a 
test on `grep /100dpi', such as

if -n "$DISPLAY"; then
  if xset q | grep "/100dpi" >/dev/null; then resolution=100
  else resolution=75
  fi
  ... -T X$resolution
else
  ...-T latin1 | less
fi

Bernd Warken


reply via email to

[Prev in Thread] Current Thread [Next in Thread]