I have a Wacom Bamboo graphics tablet that I use fairly infrequently. Today, however, I wanted to use it for a small demonstration. The problem was that the official support for Linux is considerably lacking. The tablet does work with the X.org Wacom driver (
xf86-input-wacom in pacman), but it doesn’t play well with multiple screens.
Luckily, a tool exists, named
xsetwacom, to configure the device to your own display. For example, this following command maps the device to a single region:
This, however, leads to another problem - what if the screen and the device surface don’t have the same aspect ratio, either? The command above is a direct corner-to-corner mapping.
Luckily, someone has written a bash script to fix this. It essentially letter-boxes the tablet surface to match the aspect ratio of the display you choose. The script requires some manual set-up, however, which I wasn’t fond of - if your tablet has multiple inputs, such as a separate stylus and eraser, you will have to edit and set-up the script twice to configure both.
I decided to exercise my non-existent bash skills to fix this. I’ve fixed the script to work with non-VGA outputs, and also make it take the device as an argument. The new script is available on Gist. To work with it, just run
mapwacom --help. This will list the available options, including ones to print the names of all available screens and Wacom devices.
Unfortunately I'm too lazy to add valid error handling, so you'd better enter the screen and device names perfectly, or the script fails catastrophically. (I’ve since re-written the script almost from scratch to support better interaction.)
Feel free to use the script. It might be useful to put it into your
.xinitrc, so it runs whenever X does. You might need to re-run the script if you re-connect the graphics tablet, but this shouldn’t be too much of an issue.