Skip to content
Peter Hutterer edited this page Dec 13, 2021 · 30 revisions

libwacom is a C library to provide information about tablet devices that is not available through the kernel. It is currently used by GNOME's mutter, the GNOME Control Center Wacom tablet applet, libinput, and others.

Note that libwacom itself does not control the behavior of the device, it merely provides information about this device (usually based on a vendor and product ID lookup).

Purpose

libwacom supplies metadata about tablet devices that is not available from the device itself. This includes information about which styli are supported, whether the tablet can be rotated, whether it's integrated into a screen, etc. This information can then be used to control the tablet itself.

For example the Wacom tablet configuration in GNOME uses the information exported by libwacom to

  • map the tablet to a screen if whether the tablet is built-in (Cintiq or tablet PC)
  • allow the tablet to change to left-handed if it is reversible
  • have a per-stylus configuration on all supported styli

libinput uses libwacom to

  • know when to rotate the tablet for left-handed users
  • know which touch devices are on the same physical device as the pen device

Git Repository and tarballs

To clone the git repository use:

git clone https://github.com/linuxwacom/libwacom.git

Released versions of libwacom are available here: https://github.com/linuxwacom/libwacom/releases

Maintainer

Peter Hutterer is the current libwacom maintainer.

Please do not send email regarding bugs or feature requests to the maintainer. Use the issue tracker instead.

Dependencies

Before building from git with you need to install the dependencies:

On Ubuntu:

First open the "Software & Updates" program and ensure the "Source code" box is enabled in the "Ubuntu Software" tab. Close the window and tell it to reload the software list if prompted. Next, install the dependencies by running:

sudo apt-get install build-essential && sudo apt-get build-dep libwacom

On Fedora or CentOS:

sudo dnf builddep libwacom

On other distributions:

Check the CI script for a list of build dependencies. Package names are usually similar across distributions, install those packages with your package manager and then proceed to build libwacom itself.

Building

libwacom currently supports autotools and the more modern meson build system. We recommend building with meson but it doesn't really matter which one of the two you pick.

Building with meson

Meson requires a build directory to be specified, here we use builddir. This directory can be removed at any time, it merely contains all the build artifacts. Navigate into the libwacom source directory and run the following commands:

meson builddir --prefix=/usr
ninja -C builddir
sudo ninja -C builddir install

To re-build simply run the ninja commands above. Removing the builddir is safe but you'll have to run meson to re-generate it.

To uninstall, run sudo ninja -C builddir uninstall and re-install the distribution-provided libwacom package to ensure all files are in place.

Building with autotools

autotools support has been removed in git master and only works for libwacom versions pre 2.0

Depending on your system, you may find it necessary to use this procedure instead of the meson instructions above. Navigate into the libwacom source directory and run the following commands:

On Fedora, RHEL, CentOS, etc:

./autogen.sh --prefix=/usr --libdir=/lib64
make
sudo make install

On Ubuntu, Debian, Mint, etc:

./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu/
make
sudo make install

On Arch, Manjaro, etc:

./autogen.sh --prefix=/usr
make
sudo make install

If you run into the following error, install the libtool package through your packaging manager.

Makefile.am: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:   its definition is in aclocal's search path.

To uninstall, run sudo make uninstall and re-install the distribution-provided libwacom package to ensure all files are in place.

Data Files

During make install, the data files are installed into the supplied prefix, usually /usr/share/libwacom. If data files have already been installed by a distribution-supplied package with a different name, there may be duplicates that prevent libwacom from working properly. To check if duplicates exist and are causing problems, run the following and ensure it does not print out an error about a "duplicate match":

libwacom-list-local-devices

If a duplicate match is found, you will need to read the Troubleshooting article's section on duplicate matches.

For local testing of new data files, you can just copy the data file(s) directly into the directory and check for duplicates as described above.

sudo cp -r /home/<path>/libwacom/data/* /usr/share/libwacom/