KScannerButtons --------------- This program monitors your scanner's buttons, and may perform some actions, once you've configured it. It has been tested with a HP 5300 C, with the SANE backend avision. This backend supports the button monitoring, so if you are using it, it's your day of luck ;-). Users have reported that the hp3900 and the plustek backend are also working. Some other backends may also support button monitoring (fujistu?), but I need people to test and report me success or failure. It is composed of : * sanebuttonsd, a daemon for monitoring the button presses (try sanebuttonsd --help for more information). This daemon is not KDE dependant, so you can reuse it whatever your frontend. * sane-list-scanners & sane-nb-buttons, little utilities which name tells all * KScannerButtons.kmdr, KScannerButtons.desktop & kscannerbuttons, respectively a Kommander application, frontend to the daemon, and it's launchers. It may be translated, using the standard GNU gettext. You have a template available in locale/KScannerButtons.kmdr.po To create a new language, create a subdirectory in locale/, copy the Makefile from locale/fr/ and put your translated po inside. The compilation of the .po into .mo is done by the top level Makefile: make locales See INSTALL for the installation procedure. It uses some experimental code found on SANE SVN, and a Kommander script. The daemon and other utilities are based on experimental code Copyright (C) 2004 Rene Rebe, rene@rocklinux.org Copyright (C) 2005 Gerhard Jäger, gerhard@gjaeger.de Copytight (C) 2006 Jean-Christophe Cardot, jice@cardot.net The icons are from the KDE Crystal SVG theme. sanebuttonsd usage ------------------ $ sanebuttonsd --help Usage: sanebuttonds [--quiet] [--daemon] [--help] [--script script_name] [sane device name] Options: --quiet: produce no output --daemon: fork in the background --help: this help page --script: run a script when a button is pressed sane-nb-buttons usage --------------------- $ sane-nb-buttons --help Usage: sane-nb-buttons [--debug] [--help] [sane device name] Options: --debug: debug output --help: this help page Using from the command line --------------------------- This is very useful especially for debugging, or testing a new SANE backend. First, you must know the scanner identifier, given by the command: $ sane-list-scanners avision:libusb:002:003 Hewlett-Packard ScanJet 5300C if you have only one SANE device (sane-list-scanners prints only one line) or your scanner is the first in the list, then it's safe to issue the following commands without the scanner id. The scanner will be autodetected. then you can use: $ sane-nb-buttons --debug avision:libusb:002:003 - OPTION[21], NAME: button 0 (ACTIVE), TYPE: BOOL, button 0 - OPTION[22], NAME: button 1 (ACTIVE), TYPE: BOOL, button 1 - OPTION[23], NAME: button 2 (ACTIVE), TYPE: BOOL, button 2 - OPTION[24], NAME: button 3 (ACTIVE), TYPE: BOOL, button 3 We have found 4 buttons! If you get this output, especially the "button #" at the end of each line, then you can safely assume that the daemon will work. then you can try the daemon in demo mode: $ sanebuttonsd avision:libusb:002:003 Scanner button 3 Button -3 was pressed Scanner button 1 Button -1 was pressed Scanner button 2 Button -2 was pressed (some lines "Message 0" may also be printed) If the buttons are numbered ("Button -#"), then it will work. Note: the button numbers returned by sanebuttons and sane-nb-buttons may differ from the physical order of the buttons on your scanner. This is backend dependant. you can also use the daemon without the GUI, with: $ sanebuttonsd --script /usr/local/bin/sanebuttonsd-test.sh -> to test the buttons from the command line $ sanebuttonsd --daemon --quiet --script ~/bin/sanebuttonsd.sh -> to run the daemon in the startup script of your desktop environment. $ sanebuttonsd --script ~/bin/sanebuttonsd.sh -> to debug the script (if a script error occurs, you will see it in the console).