Package: scanbuttond
Version: 0.2.3-2
Severity: wishlist

The appended buttonpressed.sh is better than the provided example in
many respects.  First of all, it works with the etch version of
scanimage.


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages scanbuttond depends on:
ii  libc6                         2.3.6-7    GNU C Library: Shared libraries
ii  libsane                       1.0.17-3   API library for scanners

Versions of packages scanbuttond recommends:
ii  sane-utils                    1.0.17-3   API library for scanners -- utilit

-- no debconf information

===File /etc/scanbuttond/buttonpressed.sh===================
#!/bin/sh

# This script is started by scanbuttond whenever a scanner button has been 
pressed.
# Scanbuttond passes the following parameters to us:
# $1 ... the button number
# $2 ... the scanner's SANE device name, which comes in handy if there are two 
or 
#        more scanners. In this case we can pass the device name to SANE 
programs 
#        like scanimage.

exec >> /var/log/scanbuttond.log
exec 2>&1

echo
echo -- $0 started on `date`

LOCKFILE="/tmp/$2.lock"
PRINTER="-P bn"

case $1 in
        1)
                echo "button 1 has been pressed on $2"
                ;;
        2)
                echo "button 2 has been pressed on $2"
                
                # Turn your scanner+printer into an A4 photocopier.
                # Requires sane-utils, lockfile-progs and netpbm.
                if ! lockfile-create --retry 2 $LOCKFILE; then
                  echo "Error: scanning already in progress for $2"
                  exit
                fi
                #set -x
                RES="--resolution 300 --contrast 10 --brightness 0"
                scanimage --verbose --device-name $2 \
                    --mode Gray -x 210 -y 297 $RES |
                  pnmtops -width=8.27 -height=11.69 |
                  lpr -J $2 $PRINTER
                lockfile-remove $LOCKFILE
                ;;
        3)
                echo "button 3 has been pressed on $2"
                ;;
        4)
                echo "button 4 has been pressed on $2"
                ;;
esac

============================================================


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to