cleanup code

This commit is contained in:
Prunebutt 2025-09-21 22:39:47 +02:00
parent a786b9ef32
commit d7a3114893

View file

@ -10,7 +10,6 @@ duplex_source='Automatic Document Feeder(left aligned,Duplex)'
color_mode='24bit Color[Fast]'
bw_mode='Black & White'
grayscale_mode='True Gray'
valid_resolutions=("100" "150" "200" "300" "400" "600" "1200")
# default options for scanning
@ -18,11 +17,10 @@ sides=$simplex_source
mode='c'
resolution='300'
current_page=$(find "$PWD" -name "out*.pdf" | sort | tail -n 1);
read -r current_pageno <<<"${current_page//[^0-9]/ }"
current_pageno=${current_pageno:-0}
next_out_file="out$((current_pageno+1)).pdf"
scan() {
@ -80,17 +78,6 @@ scan() {
case "$1" in
scan)
scan "${@:2}"
exit 0
if [ "$2" = "duplex" ]; then
true
fi
# cat <<EOF
echo "Scanning to '$next_out_file'..."
scanimage --device-name=$device --format=pdf --output-file="$next_out_file" \
--mode="$scanner_mode" --resolution="$resolution" \
--source="$source"
;;
*)
echo "Usage: scanbuddy"