Score:0

How to map touchscreen to primary monitor automaticaly

gb flag

I use a board with 2 monitors and a touchscreen(Vendor is Weida). I use the DP-1 monitor as the primary monitor and eDP-1 as an extended monitor. When I power on the board the touch screen will map to these 2 monitors since they are extended screens. But actually, I want to use the touch screen only on DP-1. I can use command xinput map-to-output 'Weida weida' DP-1 to remap the touch screen. But sometimes the touch screen will relink due to the EMI of USB HUB.

At first, I want to write a udev rule to implement this requirement. But I found that udev cannot call xinput :

ENV{ID_VENDOR_ID}=="222a", ENV{ID_MODEL_ID}=="0001", ACTION=="add", KERNEL=="event*", ENV{XAUTHORITY}=="/home/matinal/.Xauthority", ENV{DISPLAY}==":0.0", RUN+="/usr/bin/xinput map-to-output 'Weida weida' DP-1"

The log shows that udev return exit code 1 after triggered this rule.

Is there any way to map the touch screen to the primary monitor automatically when touching screen plug in?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.