Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37863023
en ru br
ALT Linux repos
S:0.2.3-alt4
5.0: 0.2.3-alt2
4.1: 0.2.3-alt2
4.0: 0.2.3-alt0.1

Group :: System/Libraries
RPM: scanbuttond

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/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.

TMPFILE="/tmp/scan.tiff"
LOCKFILE="/tmp/copy.lock"

case $1 in
1)
echo "button 1 has been pressed on $2"

# This example turns your scanner+printer into a photocopier.
# Fine-tuned for the Epson Perfection 2400, the HP LaserJet 1200 and
# ISO A4 paper size so that the scanned document matches the printer
# output as closely as possible.
#
# if [ -f $LOCKFILE ]; then
# echo "Error: Another scanning operation is currently in progress"
# exit
# fi
# touch $LOCKFILE
# rm -f $TMPFILE
scanimage --device-name $2 -x 215 -y 297 1> /tmp/image.pnm
gimp /tmp/image.pnm
# tiff2ps -z -w 8.27 -h 11.69 $TMPFILE | lpr
# rm -f $LOCKFILE
#
;;
2)
echo "button 2 has been pressed on $2"
scanimage --device-name $2 -x 215 -y 297 1> /tmp/image.pnm
lpr /tmp/image.pnm
;;
3)
echo "button 3 has been pressed on $2"
scanimage --device-name $2 -x 215 -y 297 1> /tmp/image.pnm
evolution mailto:?attach=/tmp/image.pnm
;;
4)
echo "button 4 has been pressed on $2"
;;
esac

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin