Skip to content

Instantly share code, notes, and snippets.

@alicraigmile
Last active May 27, 2016 21:43
Show Gist options
  • Save alicraigmile/1463bf55510766995de18f08fb0c958f to your computer and use it in GitHub Desktop.
Save alicraigmile/1463bf55510766995de18f08fb0c958f to your computer and use it in GitHub Desktop.
#!/bin/bash
# Scan to PDFs using my Epson Stylus XS125
# Usage: in .bashrc, source scanner.sh
find_scanner () {
scanimage -L -d epson2 | sed -e "s/device \`//" -e "s/'.*//"
}
scan () {
echo "Scanning USB bus for scanners..."
SCANNER=$(find_scanner)
echo "Starting gscan2pdf with '$(echo $SCANNER)'..."
gscan2pdf --device="$(echo $SCANNER)"
echo "gscan2pdf closed down. Bye."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment