I recently switched from GNOME to KDE. While GNOME maps touchscreens to the correct devices automatically, KDE does not. I basically have to re-map manually every time I connect or disconnect a screen.
The commands are:
Code: Select all
xinput --map-to-output $(xinput --list --id-only "Wacom Pen and multitouch sensor Finger touch") eDP-1
xinput --map-to-output $(xinput --list --id-only "Wacom Pen and multitouch sensor Pen stylus") eDP-1
xinput --map-to-output $(xinput --list --id-only "Wacom Pen and multitouch sensor Pen eraser") eDP-1
So I created a file /etc/udev/rules.d/99-map-touchscreen.rules
Code: Select all
SUBSYSTEM=="drm", ACTION=="change", RUN+="xinput --map-to-output $(xinput --list --id-only "Wacom Pen and multitouch sensor Finger touch") eDP-1"
SUBSYSTEM=="drm", ACTION=="change", RUN+="xinput --map-to-output $(xinput --list --id-only "Wacom Pen and multitouch sensor Pen stylus") eDP-1"
SUBSYSTEM=="drm", ACTION=="change", RUN+="xinput --map-to-output $(xinput --list --id-only "Wacom Pen and multitouch sensor Pen eraser") eDP-1"
Output of udevadm monitor --environment --udev while disconnecting and connecting the screen:
Code: Select all
UDEV [1996.738365] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVLINKS=/dev/dri/by-path/pci-0000:00:02.0-card
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_FOR_SEAT=drm-pci-0000_00_02_0
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=3229
SUBSYSTEM=drm
TAGS=:uaccess:seat:master-of-seat:
USEC_INITIALIZED=6498190
UDEV [1999.787795] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVLINKS=/dev/dri/by-path/pci-0000:00:02.0-card
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_FOR_SEAT=drm-pci-0000_00_02_0
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=3230
SUBSYSTEM=drm
TAGS=:uaccess:seat:master-of-seat:
USEC_INITIALIZED=6498190
Thanks in advance,
Malte