sane-project-backends/tools/hotplug-ng
Julien BLACHE 13f51314cb Add missing quotes in the grep line. 2005-03-03 13:47:39 +00:00
..
README Added new hotplug/hotplug-ng hook with scripts and documentation. 2005-02-21 21:00:57 +00:00
convert-usermap.sh Added new hotplug/hotplug-ng hook with scripts and documentation. 2005-02-21 21:00:57 +00:00
libsane.hotplug Add missing quotes in the grep line. 2005-03-03 13:47:39 +00:00

README

hotplug/hotplug-ng hook for sane-backends
-----------------------------------------

The libsane.hotplug script is intended to replace the existing hotplug scripts,
as those won't be usable with the new hotplug-ng. The libsane.hotplug script
works with both hotplug and hotplug-ng.

This script is provided in the hope that it will be useful, simpler, faster and
more extensible than the current usermap approach.


INSTALLATION
------------

Install libsane.hotplug in /etc/hotplug/usb, and make it executable.

Create the directory /etc/sane.d/hotplug, then run the convert-usermap.sh
script on libsane.usermap to produce the libsane.db file:
    $ ./convert-usermap.sh libsane.usermap

The libsane.usermap file can be found in the tools/hotplug directory; for now
the usermap file remains the authoritative source for the list of USB scanners.


FILE FORMAT
-----------

The libsane.db contains 5 tab-separated fields:

0xVVVV<tab>0xPPPP<tab>root:scanner<tab>0660<tab>optional_script

Fields:
 - vendor ID
 - product ID
 - ownership (user:group)
 - permissions
 - path of an optional script to run (it can be omitted)


USAGE
-----

When run by hotplug/hotplug-ng, the libsane.hotplug script will grep for
^0xVVVV[[:space:]]0xPPPP in /etc/sane.d/hotplug/*.db. If a match is found,
the settings are applied to the device.

The optional script is then run; this script can access the environment
variables set by hotplug/hotplug-ng (see the documentation). The libsane.hotplug
script will also set and export the DEVVID and DEVPID variables, containing the
vendor and device ID of the scanner (of the form VVVV and PPPP).