WACOM Tablet in Dual-Monitor Ubuntu System

12.09.11

Kategori: General , MyPaint & Gimp

While I have a couple of monitors lying around, only recently do I play around with them, hooking an extra LCD monitor to my laptop. Though Ubuntu handles this arrangement without a hitch, a small problem is the mapping from graphic tablet to the screen. By default, full 8:5 tablet area will be mapped to the whole 32:9 (double widescreen) desktop, which skews cursor movement and makes sketching/painting difficult.

With a bit of reading manpages and trying out tools provided with Wacom driver, I found xsetwacom lets me get what I want: the usual 1:1 tablet-to-screen coordinate mapping in a multi-monitor GNU/Linux system. I haven't found any GUI-based application, though, so the following procedures are strictly terminal-bound.



Setting tablet device parameters

First, we have to know the exact name Ubuntu recognize our device as. There are two commands we can use:

  • xinput list lists all X input devices. Tablet graphics are under Virtual core pointer category.
  • xsetwacom list dev lists only devices handled by Wacom X input device driver. It's suffixed with general type of the device, like STYLUS, ERASER or TOUCH. For my purpose, I ignore anything other than STYLUS device.

In my case, it's "Wacom Bamboo 4x5 Pen". Knowing the device's name, we can then invoke

xsetwacom get "Wacom Bamboo 4x5 Pen" PARAMETER

to get the value of the specified device's PARAMETER, or

xsetwacom set "Wacom Bamboo 4x5 Pen" PARAMETER VALUE

to set the value of the device's PARAMETER to VALUE.

Mapping tablet area to a screen

We need either one of these two parameters to accomplish our goal:

  • Screen_No (defaults to -1, all screen), confines cursor as controlled by the stylus to any of available screens, numbered from 0. In other words, we can get undistorted tablet:screen mapping, at the cost of the tablet being usable in one screen only.

  • TwinView (defaults to none). With possible values of none, horizontal and vertical, this option lets us use the tablet in all of our screens, one at a time. To change screen, simply move the cursor to current screen's edge closest to an adjacent screen, and the cursor will jump to the same position in that other screen. The following graphics (screenshot taken from Monitor Preferences) illustrates how it works in my monitor setup:

    It's constrained to a particular axis of alignment, though. So if your monitors are not all aligned in one axis (L-shaped monitor setup? :), you may get a less than satisfying result.

I use the second option, using TwinView, although that means I have to cope with occasional annoyance when I try to click something and accidentally move the cursor too close to the edge, or when a window/dialog pops up in a screen the tablet's not currently used in (GIMP's New Document dialog comes to mind).

Set parameters on startup

A caveat on using xsetwacom directly is that all parameter settings will be lost when the computer's reset, or the device plugged out. The driver's parameters must be reset each time the computer starts. I use the simplest way to automate this task, using bash's ~/.profile or ~/.bash_profile script executed for login shell. These are relevant lines in my ~/.profile script:

xsetwacom set "Wacom Bamboo 4x5 Pen" TwinView Horizontal
xsetwacom set "Wacom Bamboo 4x5 Pen" PressCurve "80 0 70 100"

(See next section for explanation of PressCurve parameter). I'm about to test using udev rules files or Ubuntu's own Upstart system to automatically set Wacom driver parameters, when need arrives, but this arrangement is good enough for me right now.

Further options

There's quite a lot of other Wacom device parameters we can tinker with through xsetwacom. We can see a list of available parameters by invoking xsetwacom list param. One other that I found useful is:

  • PressCurve (defaults to 0 0 100 100), handle coordinates that plot bezier curve for pen pressure, in a 100x100 cartesian graph. The default value puts each handle right at each endpoint, resulting in a linear curve. I'm currently trying 80 0 70 100 which makes low pressure stroke easier to make, and the tablet feels a bit more pressure-sensitive, when using GIMP:

    GUI-oriented users can more easily configure this parameter using wacom-utility, from the screenshot of which I get the graph above.

I tried most other options, but none seems useful to me. I hope this writing's useful to you!