mirror of
https://github.com/rocketraman/sane-scan-pdf.git
synced 2025-05-15 23:20:18 -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=
|
||||
VERBOSE=0
|
||||
SKIP_EMPTY_PAGES=0
|
||||
SOURCE=""
|
||||
|
||||
TMP_DIR=$(mktemp -d -p "" scan.XXXXXXXXXX)
|
||||
cleanup()
|
||||
@ -39,6 +40,8 @@ cleanup()
|
||||
}
|
||||
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
|
||||
while [[ $# > 0 ]]; do
|
||||
case "$1" in
|
||||
@ -191,7 +194,6 @@ if [[ $USEARRAY == 1 ]]; then
|
||||
OUTPUT=("${OUTPUTARR[@]}")
|
||||
fi
|
||||
|
||||
SOURCE=""
|
||||
if [[ $DUPLEX == 1 ]]; then
|
||||
SOURCE="--source \"ADF Duplex\""
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user