Commit graph

10 commits

Author SHA1 Message Date
Peter Hutterer
e723398c14 tools: rename list-quirks to the more generic "quirks list"
Enables us to easily add more tools where needed and it is
more consistent with the existing tools.

The commands are now:
   libinput quirks list
   libinput quirks validate

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/66

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-03 15:16:59 +10:00
Peter Hutterer
07e93f077e tools: move printing device quirks to the shared tools lib
This way we can re-use this from libinput-record instead of having to
duplicate all this. Since the two tools use different printfs, just make the
actual printing a simple callback.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 13:59:30 +10:00
Peter Hutterer
efe954aea8 tools: list-quirks: make the output easier to parse
Print the "has no quirks" to stderr to keep stdout tidy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 14:01:17 +10:00
Peter Hutterer
39cc6d054a tools: list-quirks: print the value of the quirk too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 14:01:17 +10:00
Peter Hutterer
91e6a84f2c tools: list-quirks: add the thumb pressure threshold property
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
201c876ab4 tools: list-quirks: fix usage to read "libinput list-quirks"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
e855605616 tools: list-quirks: compress a condition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
8aef361062 quirks: explicitly cast the log priority
The values are the same and this is ABI so they will never change. Make the
cast explicit for coverity's benefit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 13:29:23 +10:00
Peter Hutterer
d0fa740ad9 Hook up list-quirks --validate for the test suite
All the tests fill fail anyway if the validation fails but this is a quick way
to fail everything early.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:37:22 +10:00
Peter Hutterer
5792af9a5f Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.

This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.

The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.

Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.

THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:33:35 +10:00