Debian – How to set device-specific mouse settings in Wayland under Libinput (Debian Gnome)

debianmousewayland

I am running a Thinkpad T470. I often dock this, meaning I have 3 mouse input devices (external Microsoft mouse, Trackpoint, and Trackpad). I'm running Debian 10 (Testing – Buster) using Gnome under Wayland.

In Gnome settings (below) I can change the sensitivity of the "Mouse" by configuring "Mouse Sensitivity". However, this changes the sensitivity of both the external mouse and the trackpoint. I like to have my trackpoint on low sensitivity, and the mouse on high.

Gnome Mouse Settings

Under Xorg, I could make a simple script to set device specific configuration settings. How would I achieve this in Wayland?

Best Answer

I did it on an x230 with Debian 10 by writing this file to '/etc/udev/hwdb.d/71-pointingstick-local.hwdb':

# /etc/udev/hwdb.d/71-pointingstick-local.hwdb
#
# This file contains a custom "hwdb" entry to set pointing stick speed for
# Wayland by "normalizing" device dpi. (for details see:
# https://wayland.freedesktop.org/libinput/doc/latest/normalization-of-relative-motion.html).
# 
# My purpose is to set touchpoint speed seperate from external mouse so I don't have
# to change it by hand every time I plug in a mouse. The touchpoint got un-useably 
# over sensitive with the last update. This worked on Debian 10, might also 
# work on Ubuntu or other derivates, circa ~2019. Good luck until they change it again :/
#
# copy the stanza for your device from /usr/lib/udev/hwdb.d/70-pointingstick.hwdb
# into this file.
#
# per https://cgit.freedesktop.org/systemd/systemd/tree/hwdb/70-mouse.hwdb
# edit sensitivity, then run:
# sudo udevadm hwdb --update
# sudo udevadm trigger /dev/input/event6 #(with your device number)
# 
# input device can be discovered with:
# sudo libinput list-devices | grep -A 20 TrackPoint

# Lenovo Thinkpad X230
evdev:name:TPPS/2 IBM TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX230:*
#POINTINGSTICK_SENSITIVITY=400 # Too fast!
 POINTINGSTICK_SENSITIVITY=100 # better...
 POINTINGSTICK_CONST_ACCEL=1.0
Related Question