add unscan and dispatch command
This commit is contained in:
parent
1391b72c26
commit
498aba165e
1 changed files with 6 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ resolution='300'
|
||||||
current_page=$(find "$PWD" -name "out*.pdf" | sort | tail -n 1);
|
current_page=$(find "$PWD" -name "out*.pdf" | sort | tail -n 1);
|
||||||
read -r current_pageno <<<"${current_page//[^0-9]/ }"
|
read -r current_pageno <<<"${current_page//[^0-9]/ }"
|
||||||
current_pageno=${current_pageno:-0}
|
current_pageno=${current_pageno:-0}
|
||||||
|
last_out_file="out$current_pageno.pdf"
|
||||||
next_out_file="out$((current_pageno+1)).pdf"
|
next_out_file="out$((current_pageno+1)).pdf"
|
||||||
|
|
||||||
scan() {
|
scan() {
|
||||||
|
|
@ -74,13 +75,17 @@ scan() {
|
||||||
--resolution="$resolution" \
|
--resolution="$resolution" \
|
||||||
--source="$sides" \
|
--source="$sides" \
|
||||||
-x 210 -y 297 # A4
|
-x 210 -y 297 # A4
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
scan)
|
scan)
|
||||||
scan "${@:2}"
|
scan "${@:2}"
|
||||||
;;
|
;;
|
||||||
|
unscan)
|
||||||
|
rm "$current_pageno"
|
||||||
|
;;
|
||||||
|
dispatch)
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: scanbuddy"
|
echo "Usage: scanbuddy"
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue