mirror of
https://github.com/rocketraman/sane-scan-pdf.git
synced 2025-05-16 23:50:39 -07:00
Use a configuration file (if it exists) to allow the user to set preferred defaults, including TMP_DIR. Also move the initalization of SOURCE above the inclusion of the configuration.
This commit is contained in:
parent
2cfa7f6899
commit
1035d998cc
4
scan
4
scan
@ -31,6 +31,7 @@ DESKEW=0
|
|||||||
DRIVER_OPTION=
|
DRIVER_OPTION=
|
||||||
VERBOSE=0
|
VERBOSE=0
|
||||||
SKIP_EMPTY_PAGES=0
|
SKIP_EMPTY_PAGES=0
|
||||||
|
SOURCE=""
|
||||||
|
|
||||||
TMP_DIR=$(mktemp -d -p "" scan.XXXXXXXXXX)
|
TMP_DIR=$(mktemp -d -p "" scan.XXXXXXXXXX)
|
||||||
cleanup()
|
cleanup()
|
||||||
@ -39,6 +40,8 @@ cleanup()
|
|||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
[ -e "${XDG_DATA_HOME:-$HOME/.local/share}/sane-scan-pdf/defaults" ] && . "${XDG_DATA_HOME:-$HOME/.local/share}/sane-scan-pdf/defaults"
|
||||||
|
|
||||||
# Parse command-line options
|
# Parse command-line options
|
||||||
while [[ $# > 0 ]]; do
|
while [[ $# > 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -191,7 +194,6 @@ if [[ $USEARRAY == 1 ]]; then
|
|||||||
OUTPUT=("${OUTPUTARR[@]}")
|
OUTPUT=("${OUTPUTARR[@]}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SOURCE=""
|
|
||||||
if [[ $DUPLEX == 1 ]]; then
|
if [[ $DUPLEX == 1 ]]; then
|
||||||
SOURCE="--source \"ADF Duplex\""
|
SOURCE="--source \"ADF Duplex\""
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user