Minor improvements
parent
b504019a23
commit
ac63955ce4
22
scanpix
22
scanpix
|
@ -30,8 +30,8 @@
|
||||||
## VARIABLES
|
## VARIABLES
|
||||||
|
|
||||||
# Default scan area in mm
|
# Default scan area in mm
|
||||||
Y_SIZE="99" # width
|
Y_SIZE='99' # width
|
||||||
X_SIZE="151" # height
|
X_SIZE='151' # height
|
||||||
|
|
||||||
## ARGUMENTS
|
## ARGUMENTS
|
||||||
|
|
||||||
|
@ -39,9 +39,9 @@ if [ $# -gt 1 ]; then
|
||||||
echo "ERROR! Too many arguments."
|
echo "ERROR! Too many arguments."
|
||||||
exit 2
|
exit 2
|
||||||
elif [ $# -eq 1 ]; then
|
elif [ $# -eq 1 ]; then
|
||||||
DIR="$1"
|
DIR="${1}"
|
||||||
else
|
else
|
||||||
DIR="$PWD"
|
DIR="${PWD}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ if [ "${SCANNER}" == "" ]; then
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
echo "found."
|
echo "found."
|
||||||
echo "Using scanner: $SCANNER"
|
echo "Using scanner: ${SCANNER}"
|
||||||
|
|
||||||
# Ask user for a directory to scan into
|
# Ask user for a directory to scan into
|
||||||
DIR=$(zenity --entry --title="Scan Location" \
|
DIR=$(zenity --entry --title="Scan Location" \
|
||||||
|
@ -66,18 +66,18 @@ DIR=$(zenity --entry --title="Scan Location" \
|
||||||
# User didn't enter a valid directory
|
# User didn't enter a valid directory
|
||||||
if [ ! -d "${DIR}" ]; then
|
if [ ! -d "${DIR}" ]; then
|
||||||
zenity --error --title="Error: Scan location not found" \
|
zenity --error --title="Error: Scan location not found" \
|
||||||
--text="Couldn't find $DIR. Try again (no trailing slashes)"
|
--text="Couldn't find ${DIR}. Try again (no trailing slashes)"
|
||||||
exit 1
|
exit 1
|
||||||
else echo "Saving photos to $DIR"; fi
|
else echo "Saving photos to ${DIR}"; fi
|
||||||
|
|
||||||
# Ask for photo size
|
# Ask for photo size
|
||||||
Y_SIZE=$(zenity --entry --title="Photo width" \
|
Y_SIZE=$(zenity --entry --title="Photo width" \
|
||||||
--text="How wide are the photos (in mm)?" \
|
--text="How wide are the photos (in mm)?" \
|
||||||
--entry-text="$Y_SIZE")
|
--entry-text="${Y_SIZE}")
|
||||||
X_SIZE=$(zenity --entry --title="Photo height" \
|
X_SIZE=$(zenity --entry --title="Photo height" \
|
||||||
--text="How high are the photos (in mm)?" \
|
--text="How high are the photos (in mm)?" \
|
||||||
--entry-text="$X_SIZE")
|
--entry-text="${X_SIZE}")
|
||||||
echo "Scanning photos at $X_SIZE x $Y_SIZE"
|
echo "Scanning photos at ${X_SIZE} x ${Y_SIZE}"
|
||||||
|
|
||||||
# Wait for first photo to be placed
|
# Wait for first photo to be placed
|
||||||
if ! zenity --question --title="Prepare scan" \
|
if ! zenity --question --title="Prepare scan" \
|
||||||
|
@ -110,7 +110,7 @@ while true; do
|
||||||
else echo "Done."
|
else echo "Done."
|
||||||
# Scan again?
|
# Scan again?
|
||||||
if ! zenity --question --title="Scan Completed" \
|
if ! zenity --question --title="Scan Completed" \
|
||||||
--text="Photo scanned to $NOW.jpg\nNow what? " \
|
--text="Photo scanned to ${NOW}.jpg\nNow what? " \
|
||||||
--ok-label="Scan another" --cancel-label="Quit"
|
--ok-label="Scan another" --cancel-label="Quit"
|
||||||
then exit 0; fi
|
then exit 0; fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue