🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #58920

Re: [slrn] How to print

#58920
From: Morten Bo Johansen
Date: Sun, 05 Mar 2000 00:00
83 lines
3389 bytes
On Sun, 05 Mar 2000 05:59:53 GMT, Mark Wagnon wrote:
>Hi all,
>
>I've searched through several websites and the local slrn
>documentation, but I can't find any reference to printing articles
>under slrn. I've checked out a few example .slrnrc files with
>similar luck. Can anyone point me in the right direction with this?

The little script below which I think is pretty neat was posted
to the mutt mailing-list recently. Using this and entering the
following line 

              set printer_name "a2psmail"

into you slrn.rc then pressing "y" in article-mode will make
slrn print the current article one-sided if it fits into one
such, otherwise it will place two sides on one page.

Needless to say you must have installed the package "a2ps" and
set up your printer for proper operation.



Morten


------------------------a2psmail begin---------------------------

#! /bin/sh
#
#  $Id: a2psmail,v 1.1 1999/08/26 17:03:10 roland Exp roland $
#
##########################################################################
#
#  Print a mail using a2ps.  If the mail fits on one page, we use "a2ps -1"
#  otherwise we print two pages on one sheet ("a2ps -2").
#
##########################################################################
#
#   Copyright (C) 1999  Roland Rosenfeld <roland@spinnaker.de>
#
#   This program is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License as
#   published by the Free Software Foundation; either version 2 of
#   the License, or (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
##########################################################################

umask 077

#DEBUG="-Pdisplay"

tmpdir=${TMPDIR-/tmp}/a2psmail.$$
mkdir $tmpdir || exit 1
trap "rm -rf $tmpdir; exit" 0 1 2 3 15

cat "$@" > $tmpdir/mail

env -u LANG a2ps -1 -gEmail -Pvoid $tmpdir/mail 2> $tmpdir/a2ps.out

if (cat $tmpdir/a2ps.out | grep -q 'on 1 sheet')
then
    # Mail fits on one page:
    a2ps -1 -gEmail $DEBUG $tmpdir/mail
else
    # Mail doesn't fit on one page:
    a2ps -2 -gEmail $DEBUG $tmpdir/mail
fi

---------------------------a2psmail end----------------------------



Technical Details
Message-ID: <slrn8c4bit.vp.mojo@swiftsnest.image.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn8c3ttg.2t1.mwagnon1@smaug.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn8c4bit.vp.mojo@swiftsnest.image.dk>
Subject: Re: [slrn] How to print
Date: Sun, 05 Mar 2000 00:00:00 +0000
From: mojo@image.dk (Morten Bo Johansen)
References: <slrn8c3ttg.2t1.mwagnon1@smaug.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 593369683
X-Complaints-To: news-abuse@wol.dk
X-Trace: news020.image.dk 952248125 212.54.94.98 (Sun, 05 Mar 2000 10:22:05 MET)
User-Agent: slrn/0.9.6.2 (Linux)
NNTP-Posting-Date: Sun, 05 Mar 2000 10:22:05 MET
Newsgroups: news.software.readers