How to Enable Touchpad Tap-to-Click in Xorg on Linux

14-11-2019




Imgur



"Xorg (commonly referred as simply X) is the most popular display server among Linux users." Arch Linux Wiki

Most Linux systems uses Xorg as the window system. This tutorial describe the steps I took to enable touchpad tap-to-click function permanently.



xorg.conf.d

Go to /usr/share/X11/xorg.conf.d and you might find a collection of files that are named:

  • 10-evdev.conf
  • 10-quirks.conf
  • 10-radeon.conf
  • 40-libinput.conf
  • 70-wacom.conf
  • 71-libinput-overrides-wacom.conf

These are configuration files for X11. What we're interested in is the 40-libinput.conf file, which contain the touchpad input class. If you cat the file, you'll see the commented out section at the top of the file stating to not copy the whole file, but rather to copy the section snippet instead. We'll copy the touchpad input class:

0
1
2
3
4
5
Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection


Libinput

You'll notice that the driver is called libinput.

"libinput is a library to handle input devices in Wayland compositors and to provide a generic Xorg input driver." Libinput FreeDesktop Wiki

Libinput is the driver that Xorg uses to be able to communicate with the touchpad on your laptop.



Enable Tapping

Once we've copied the section, we're going to go to /etc/X11/xorg.conf.d. This is the directory where we're going to place the config file to overwrite the touchpad config. Create a file called 30-touchpad.conf at /etc/X11/xorg.conf.d. Paste the section we've copied earlier into the file. Now the content of 30-touchpad.conf should look something like this:

0
1
2
3
4
5
Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Libinput provide options for the touchpad to be able to tap-to-click, this option is called "Tapping". To enable it, we're going to turn it on. Add the option in a line before EndSection. Now 30-touchpad.conf should look like this:

0
1
2
3
4
5
6
Section "InputClass"
	Identifier "libinput touchpad catchall"
	MatchIstouchpad "on"
	MatchDevicePath "/dev/input/event*"
	Driver "libinput"
	Option "Tapping" "on"
EndSection

To have the new configuration take effect, restart your laptop.



Conclusion

I hope you've found this post useful, because I've struggled with trying to enable tapping on my touchpad before, and this is the way I've enabled it myself. Cheers!