Re: [netatalk-admins] hiding laserwriters


Subject: Re: [netatalk-admins] hiding laserwriters
From: Gerry.Tomlinson (Gerry.Tomlinson@newcastle.ac.uk)
Date: Wed Feb 25 1998 - 05:59:00 EST


>
>
> Is there a good way to hide a laserwriter from the
> Chooser? This would be in the interest of having
> all print jobs go to the unix-spooled device (which
> *would* still show up in the Chooser), instead
> of haphazardly from various locations.
>
> One way would probably be to change the printer type
> from laserwriter to something else. Has anyone
> done this with good results?
>

I use the following rc script to change the printer(s) type -
I run it from cron since most printers revert to LaserWriter
when powering on.

#!/usr/local/bin/rc
#
# hidelw [-a] printer ...
#
# change the nbp type of a laserprinter to that
# specified in its .paprc file causing it to be hidden from the chooser
# if the type is not LaserWriter.
# gets the nbp name from the spool dir .paprc file too
#
# printer is a spool queue name
#
# -a option looks for all printers with a .paprc file

path = (/usr/local/atalk/current/bin /usr/local/sbin /usr/local/bin $path)
if (~ $#* 0) {
        echo usage: `{basename $0} [-a] printer .... >[1=2]
        exit 1
}

if (~ $1 -a) {
        for (i in /var/spool/lpd/*/.paprc) printers = ( $printers `{basename `{dirname $i}} )
} else printers = $*

for (i in $printers) {
    if ( [ -d /var/spool/lpd/^$i ] ) {
        name = `{sed 's/:.*//' < /var/spool/lpd/^$i^/.paprc}
        type = `{sed 's/.*://' < /var/spool/lpd/^$i^/.paprc}
        papstatus -p $^name >/dev/null >[2=1] &&
        pap -p $^name << END
        (%EtherTalk_NV%) << /EtherTalkType ($type) >> setdevparams
END
    } else echo >[1=2] $i: no such printer
}

> The bad thing would be various Mac utilities not
> being able to see the printer anymore, such as
> Font Downloader or LaserWriter Utility, but it
> might still be worth the hassle.
>
>

you can resedit the mac utilities to use the new type name for
occasions when you really do want to get directly at the printer.

        Gerry.

---
Gerry.Tomlinson@newcastle.ac.uk
Computing Officer
Department of Computing Science, University of Newcastle, Tel: +44 191 222 8139
Newcastle upon Tyne, NE1 7RU, United Kingdom.             Fax: +44 191 222 8232



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:31:12 EST