about summary refs log tree commit diff stats
path: root/home-manager/packages/scripts/apps
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-05-18 12:28:33 +0200
committerSoispha <soispha@vhack.eu>2023-05-18 12:34:57 +0200
commit6aea234a6d4043d308ae30e4494069673c963ca7 (patch)
tree7a11d39fe83a37993d7a2a4128441f19393e727b /home-manager/packages/scripts/apps
parentFix(hm/pkgs/scr/con2pdf): Add status output (diff)
downloadnixos-config-6aea234a6d4043d308ae30e4494069673c963ca7.tar.gz
nixos-config-6aea234a6d4043d308ae30e4494069673c963ca7.zip
Fix(hm/pkgs/scr/con2pdf): Don't try batch mode when using the Flatbed
Diffstat (limited to 'home-manager/packages/scripts/apps')
-rwxr-xr-xhome-manager/packages/scripts/apps/con2pdf20
1 files changed, 13 insertions, 7 deletions
diff --git a/home-manager/packages/scripts/apps/con2pdf b/home-manager/packages/scripts/apps/con2pdf
index 334749ab..a3e45e29 100755
--- a/home-manager/packages/scripts/apps/con2pdf
+++ b/home-manager/packages/scripts/apps/con2pdf
@@ -54,17 +54,23 @@ scan() {
     cd "$tiff_temp_path" || die "Bug"
 
     msg "Started scanning...";
-    for i in $(seq "$number_of_pages");do
+    if [ "$method" = "Flatbed" ]; then
         do_until_success \
-            "scanimage --format=tiff --progress --source='$method' --device='$device' --batch=%d.tif --batch-increment='$number_of_pages' --batch-start='$i'" \
+            "scanimage --format=tiff --progress --source='$method' --device='$device' --output-file=1.tiff" \
             "warn 'Retrying scan, as we assume a network error!'"
+    else
+        for i in $(seq "$number_of_pages");do
+            do_until_success \
+                "scanimage --format=tiff --progress --source='$method' --device='$device' --batch=%d.tif --batch-increment='$number_of_pages' --batch-start='$i'" \
+                "warn 'Retrying scan, as we assume a network error!'"
 
 
-        if [ "$number_of_pages" -ne 1 ];then
-            msg "Finished turn, please change side!";
-            readp "Press enter to continue" noop
-        fi
-    done
+            if [ "$number_of_pages" -ne 1 ];then
+                msg "Finished turn, please change side!";
+                readp "Press enter to continue" noop
+            fi
+        done
+    fi
 
     msg "Creating output directory...";
     mkdir "$output_directory";