RFE: libinput analyze-device
I'm thinking about a helper tool that could be quite useful, specifically for self-debugging. Something that prints basically this information:
$ libinput analyze-device /dev/input/event2
libinput version: 1.20
## udev
✅ ID_INPUT property is set
✅ ID_INPUT_TOUCHPAD property is set
✗ ID_INPUT_MOUSE property is set
✗ ID_INPUT_POINTINGSTICK property is set
## evdev
✓ device is is a clickpad
⚠️ device is a semi-mt touchpad
The output ideally in nicely formatted columns, and with coloured output.
The goal here would be to identify common issues quickly instead of having to dig through various other output files. This could also then be folded into the documentation for some self-help.
The colouring of the output is the tricky bit because ideally anything red should indicate an actual issue. But just a yes/no doesn't mean something is a bug:
- ID_INPUT is an obvious yes/no, we need that property, always
- ID_INPUT_TOUCHPAD may be set, but must not be set if e.g. ID_INPUT_MOUSE is set. Or it must be set no other ID_INPUT is set.
- ID_INPUT_POINTINGSTICK and ID_INPUT_TABLET_PAD must only be set if ID_INPUT_MOUSE or ID_INPUT_TABLET are set, respectively.
- "is a clickpad" is just either/or. This would also apply to touchpad/keyboard integration
- semi-mt is just a warning, it'ss not a problem per se but it negatively affects libinput's behaviour
- etc.
Writing this in python would be trivial enough (the technical parts anyway) but if we want to integrate from libinput it gets a bit more complicated, so it may actually be easier to write this in C.