Skip to content
Jason Gerecke edited this page Jul 28, 2020 · 30 revisions

Libwacom is a library to help implement Wacom tablet settings. It is intended to be used by client-programs that need model identification. It is already being used by the gnome-settings-daemon and the GNOME 3.4 Control Center Wacom tablet applet. In the future, the xf86-input-wacom driver may use it as well.

Purpose

Libwacom supplies metadata about Wacom tablets including whether or not they are connected to your system, the list of styli it supports, as well as information about the styli themselves. In the past this information was only available within the drivers (as comments), exported in different ways (sysfs attributes), non-machine readable in public documentation, or, worst of all, hidden in Wacom's internal drivers for OS X or Windows.

For example the Wacom tablet applet UI uses information exported by libwacom such as:

  • whether the tablet is built-in (Cintiq or tablet PC) or external
  • which form factor it has and is it right or left-handed reversible
  • the list of styli it supports
  • for each stylus, its full name, the number of buttons, is there an eraser, what it looks like

After knowing what each tablet has to offer, a way to match the definitions to XInput devices, assign settings per-tablet, and importantly, switch stylus configuration when the user switches stylus was needed. This is done using the new GsdWacomDevice and GsdWacomStylus objects, shared between gnome-settings-daemon (which will apply the configuration) and gnome-control-center (which will set the configuration).

There are also a few debugging applications, such as list-wacom in gnome-settings-daemon, to show the attached GsdWacomDevices, or test-wacom in gnome-control-center, to test the display of tablets not available to you.

Git Repository and Tar Files

To clone the git repository use:

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

Maintainer

Peter Hutterer is the current libwacom maintainer. Bastien Nocera is the original maintainer.

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

Dependencies

Before building from git with ./autogen.sh, 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

If the above command does not work, you may attempt to manually install the build dependencies instead:

sudo apt-get install build-essential libgudev-1.0-dev libxml++2.6-dev

On Fedora:

sudo yum-builddep libwacom

or

sudo dnf builddep libwacom

On Centos 6:

sudo yum install libgudev1-devel

Building

libwacom currently supports autotools and the more modern meson build system. As user 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.

Building with autotools

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 are building on Ubuntu and run into the following error, run sudo apt-get install libtool and then reattempt the build.

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.

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, 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/