Dynamically setting the libinput Calibration Matrix
I am running Xorg and I am trying to use information from my computer’s accelerometer to set the orientation of a tablet input device. I was able to get this to work using a udev rule, as described in the section of the libinput documentation Static device configuration via udev.
(In case you would like more details, a link to the actual code I am using to update the udev rule based on the accelerometer data is here.)
Problem
The main problem is that this method involves running the udevadm trigger
command, which requires root privilege on my machine, so I would like to know another way to set this calibration matrix. In addition, after the calibration matrix is set, some of my programs that receive input data through libinput do not seem to be aware of the orientation change unless they are restarted.
I would like to understand what is happening and potentially learn another way to update the calibration matrix to change the input orientation for these other programs. Ideally, I would like a way that does not require root privileges and does not require a restart of these other programs.
I have two questions:
- Why might some applications which use device information provided by libinput not seem to be aware of the change of the tablet orientation after such a udev rule has been triggered? In contrast, why does the orientation of the tablet input received by X seem to change immediately after the udev rule sets LIBINPUT_CALIBRATION_MATRIX (without having to restart X, for example)?
- Is there another way to update the calibration matrix dynamically, either system-wide or for specific applications, without using the udev rule?