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