done
}
+function scan () {
+ n=1
+
+ while [[ -f "${HOME}/scan-${n}.jpg" ]]; do
+ n=$((n+1))
+ done
+
+ while [[ "$1" ]]; do
+ if [[ "$1" == "color" ]]; then
+ OPTS+=" --mode=color"
+ elif [[ "$1" == "a4crop" ]]; then
+ OPTS+=" -l 5 -t 0 -x 200 -y 290"
+ else
+ echo "Unknown argument \`$1'"
+ fi
+ shift
+ done
+
+ echo "**"
+ echo "** Scanning to ${HOME}/scan-${n}.jpg"
+ echo "**"
+
+ scanimage -d genesys:libusb:001:056 \
+ --format=pnm \
+ --mode=color \
+ --depth=8 \
+ -v \
+ --resolution=300 \
+ ${OPTS} | \
+ convert -rotate 180 - "${HOME}/scan-${n}.jpg"
+
+ echo "** Done".
+}
+
# A password generator
function genpw () {
alias a='cd /tmp/at'
function trash () {
- TRASH=$(date +/tmp/trash-%Y-%b-%d-%Hh)
+ TRASH=$(date +/tmp/trash-${USER}-%Y-%b-%d-%Hh)
LINK=/tmp/trash
mkdir -p ${TRASH}