I want to start a scan from a terminal and view the image automatically upon completion. How can I do this without knowing the saved filename? I am currently running Ubuntu 16.04 LTS locally on my notebook, which is connected via USB to my scanner.
I wrote the following terminal command; however, the problem is that if more than one minute lapses during the scanning process then Eye of Gnome cannot find the image file, and I receive an error message:
scanimage --format=tiff > ~/Pictures/$(date +%Y%m%d_%H%M).tiff && sleep 5 ; eog --fullscreen ~/Pictures/$(date +%Y%m%d_%H%M).tiff
For example, an image file will be saved as
20170128_2314.tiff, but Eye of Gnome or EOG will search for
20170128_2315.tiff resulting in an error. And depending on the scanner resolution setting, it may take 1-5 minutes to scan from start to finish.
The image files are currently being saved to my home directory ~/Pictures folder.
Any help or input would be greatly appreciated.