How to get your Lenovo T440 touchpad working in Ubuntu (or any other Debian distribution)

Since the Lenovo T440 has a one-button touchpad it doesn’t behave like it should automatically in Ubuntu. After looking for solutions and not finding anything I asked around in the Ubuntu IRC channel and the user crimson_king helped me with a script. In this post I’ll show how to install and use the script (this will probably work on other one-button touchpads too).

First open Terminal with CTRL + ALT + T and type in cd /etc/X11/xorg.conf.d:

Next type sudo vim 40-libinput.conf and fill in this script:

Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "on"
Option "ClickMethod" "clickfinger"
Option "HorizontalScrolling" "on"
Option "ScrollMethod" "twofinger"
Option "TappingDrag" "on"
EndSection

This script will make your touchpad function like it would with the Windows drivers.

Controls:
One-finger click: left mouse button.
Two-finger click: right  mouse button.
Two-finger swipe: scrolling.

I hope this post will help some people! For more information about this you can go here.