Skip to Content.
Sympa Menu

baslinux - [BL] help with a printing script?

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: [BL] help with a printing script?
  • Date: Tue, 25 Mar 2008 13:39:49 -0500 (CDT)

I'd like to create a script for printing from my new BL laptop. Sindi has a script at her site which is close to what I need, but not quite. The reason her script won't work so well for me is because I don't always have a parallel port connected to this laptop: the laptop has one of those "i/o bars" that has to be hooked to the machine and that has the parallel port on it, and it will not always be hooked up. It will obviously be no good to go insmod'ing modules for a non-existent parallel port. So I'd like to add to her script some routine for checking whether the parallel port modules have already been inserted--like by using the output of lsmod. If they have not been inserted, the script should ask whether to insert them and then do so or abort, accordingly. Finally, her script seems to need to run with a filename specified. Instead of that, I'd like to just have a terminal output the command (e.g., using echo) that one should enter into the terminal in order to print. Something like "To print a file on this machine, enter the command gs -sOutputFile=/dev/lp0 /path/to/file". Can anyone offer me some help on this? See below for Sindi's script.

--------begin Sindi's printing script------------------------
#!/bin/sh
insmod parport
insmod parport_pc
insmod lp

#/var/spool/lpd/postscript/deskjet.filter < $1 > /dev/lp0
#gs -q -dSAFER -sDEVICE=deskjet -r300x300 -sPAPERSIZE=letter -sOutputFile=- - -dFirstP
gs -r300 -sOutputFile=/dev/lp0 $1
---------end Sindi's printing script---------------------------

Thanks,
James




Archive powered by MHonArc 2.6.24.

Top of Page