Scanner infrastructure in freedesktop

Donald Straney burntfuse at gmail.com
Sat Jan 20 14:08:13 PST 2007


> I saw your job. But, regardless of the nice features it implement, it's
> a SANE only piece of code that seems more like a tiny hack rather than a
> real infrastructure. I far from mean this is a waste :). However, i
> would like to see emerging a dbus daemon which handle hotplug from HAL,
> events from scanners and shares via avahi and maybe scan via a dbus API.

I don't see any problem with using only SANE, since it's the standard
Linux scanner API.  If it's missing something major then it's probably
easier to just add support for it to SANE than to come up with a whole
new backend system, which just complicates things (and adds too many
abstraction layers).

As for a scanner infrastructure, maybe my opinion doesn't count as
much since I'm not part of any major desktop project, but that sounds
like a great idea to me.  Starting a scan through a dbus API could be
useful, but since there's just one backend (SANE) instead of
completely different ones for KDE or GNOME, it would be easier to just
link scanning programs with libsane.  Also, it seems like it would be
sort of inefficient, since the entire image would either have to be
stored in a temporary file and deleted by the program (involves a lot
of disk I/O) or the entire thing would have to be passed over dbus,
which wasn't meant for that kind of thing.

Modifying SANE to work with dbus would be the good part, though, since
then when it searches for supported scanners, it could use Avahi or
HAL to detect scanners and possibly use the info from HAL to configure
them.

Making it send dbus events for button presses would also be useful.  I
can see two main uses for this - for one thing, scanning programs can
react to them, and more important, the desktop environment can catch
the notifications and use them to launch programs.  For example, KDE
and GNOME could have scanner action config dialogs where you can set a
program to launch when the "scan" button on the scanner is pressed.
Actually, it would be nice to have some way for programs to register
themselves for this, since it would be a pain for the readme for a new
scanner program to have to tell people to go to config dialog X and
add a certain command in a certain place.  Maybe there could be a
directory where .desktop files would be stored?  It seems like
something static would be the best for this (having a dbus API to
register a program would be pointless, since it would have to be
repeated at boot every single time).

Anyways, sorry for the rambling, but some kind of scanner
infrastructure that takes advantage of all this stuff would be great.

Donald Straney



More information about the xdg mailing list