mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 17:20:04 +01:00
The easiest way to get a device group is by looking at the phys path of the
input device (which looks like usb-0000:00:14.0-1/input1) and dropping the
/inputX bit. The rest is the same for devices that belong together (except on
the Cintiq 22HD Touch).
Ideally we could just take ATTRS{phys} but we can't select substrings to drop
into ENV so we need to do it ourselves. This patch adds a callout that takes a
syspath and prints the mangled path, to be used in LIBINPUT_DEVICE_GROUP.
The rule triggers on any device that has a non-zero phys attribute, this
groups devices like tablets together but also devices like mice with multiple
interfaces.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
8 lines
242 B
Text
8 lines
242 B
Text
ACTION!="add|change", GOTO="libinput_device_group_end"
|
|
KERNEL!="event[0-9]*", GOTO="libinput_device_group_end"
|
|
|
|
ATTRS{phys}=="?*", \
|
|
PROGRAM="libinput-device-group %S%p", \
|
|
ENV{LIBINPUT_DEVICE_GROUP}="%c"
|
|
|
|
LABEL="libinput_device_group_end"
|