-
-
Save mikesclassicads-dep/defbc30b944756c277c27f54a82dfe2d to your computer and use it in GitHub Desktop.
Revisions
-
Deevad created this gist
Apr 5, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/bash # Quick scan: a script to obtain a PNG 300ppi scan on your home folder. # Configure: change the device name (line 11) with your scanner ID running: scanimage -L # Dependencies: sane and libsane to scan (line 11) , imagemagick for cleaning (line 13), and notify-send for pretty D.E. notification (line 16). # License: CC-0; author <[email protected]> version=$(date +%Y-%m-%d_%Hh%M%S) touch /tmp/"$version"_scanner.tiff scanimage --device genesys:libusb:002:012 --resolution 300 --mode Color --format=tiff > /tmp/"$version"_scanner.tiff convert /tmp/"$version"_scanner.tiff -units PixelsPerInch -strip -interlace Plane -density 300 -colorspace sRGB -background white -alpha remove -define png:compression-strategy=3 -define png:color-type=2 -define png:compression-level=9 $HOME/"$version"_scanner.png if [ -f $HOME/"$version"_scanner.png ]; then notify-send -i $HOME/"$version"_scanner.png "Scanned : "$version"_scanner.png" fi if [ -f /tmp/"$version"_scanner.tiff ]; then rm /tmp/"$version"_scanner.tiff fi # End