2

I have a Canon Lide 120 scanner connected to my Ubuntu computer via standard USB.

To scan a document I have to open the scanner app, hit the scan, and then select a directory to save the image into. This is very time consuming, because I need to scan billions of pictures every day.

Is there any way to bind say a hotkey on my keyboard, or to rig a button on the scanner, so that if I press they hotkey or the scanner button, it will immediately scan the document inside of the scanner and save it into a directory, with no extra interaction needed?

Thanks

Askerman
  • 826
  • How is your Canon scanner installed? Did you install the SANE driver or are you running scangearmp? – Takkat Oct 19 '17 at 13:23
  • I don't know, I have been using the scanner on windows only, till now, but decided to switch to Ubuntu 16.4 and will be plugging the scanner into it tomorrow. Your driver question is very scary, because I assumed it's plug and play like on windows. – Askerman Oct 19 '17 at 14:46
  • Canon unfortunately does not provide open source drivers but they offer a proprietary solution including software scangearmp. AFAIK presently we can also get it work out of the box with SANE but I can't test this (I don't have that scanner any more). See e.g. https://askubuntu.com/questions/33126/getting-a-canon-lide-200-to-work – Takkat Oct 19 '17 at 17:44
  • After I connected the scanner today, my worst nightmare came true. It wasn't working. I installed the latest sane drivers and.. nothing. I even followed that tutorial where I edit the config file and add the usb 0x111 0x111 (something like that) but lide 120 was already added there. Yet the xsane scan app, nor simple scan were able to find the scanner. But then by mistake I ran the simple-scan as sudo simple-scan and it worked! The scanner commands work now, but only as sudo (plus when i select text in simple scan, the image comes out as pixelated mess) – Askerman Oct 20 '17 at 13:59
  • Thank you, it seems to work fine now. I have one last thing regarding this: Is there any way to make the buttons on the scanner work? More specifically, I would like to be able to assign a shell script to them, or a terminal command. – Askerman Oct 21 '17 at 20:46
  • You might also find the keyboard shortcuts in simple-scan useful: ctrl + f to scan all images from the feeder, ctrl + s to save the scan as a one PDF or multiple JPGs. You will see a file dialog but simple-scan remembers the directory most recently used. Press ctrl + ? to see all keyboard shortcuts. – Matthias Braun Apr 19 '21 at 16:43

1 Answers1

1

To have access to a scanner we need the permission to do so. This is done by making us member of the group scanner either with the graphical users tool or from the command line with

sudo usermod -aG scanner $USER

Having the scanner buttons work on the Ubuntu desktop is a different story. I do not know how to do that with your scanner or the driver you use. There may be a proprietary software to help you with that.

However it is possible to assign a command line scanning command to a custom keyboard shortcut. If we had installed the scanner with the SANE backend we can use scanimage for this, e.g.:

 scanimage -x 200 -y 300 --format=tiff >image.tiff

For more options see the manpage for scanimage.

Takkat
  • 142,284