Using Wacom tablet with dual monitors (TwinView) in Ubuntu

I have a setup with two monitors on my computer and wanted to restrict my Wacom tablet to only one of the screens. Otherwise, the tablet is expanded to the entire two screens, making any drawing stretched.

This has shown to be quite simple to fix if you can live with a script doing the job for you. First, type the following in a terminal and note the output:

xinput --list

You will see a bunch of names for you peripheral devices. You should look for anything that has to do with "Wacom". For instance, on my machine, I see these names:

⎡ Virtual core pointer                     id=2    [master pointer  (3)]
⎜   ↳ Wacom Graphire4 4x5 eraser                id=12   [slave  pointer  (2)]
⎜   ↳ Wacom Graphire4 4x5 cursor                id=13   [slave  pointer  (2)]
⎜   ↳ Wacom Graphire4 4x5 pad                   id=14   [slave  pointer  (2)]
⎜   ↳ Wacom Graphire4 4x5 stylus                id=15   [slave  pointer  (2)]

Now, create a file somewhere on your computer. I've put mine in a subdir of my home directory, naming it "wacom-settings.sh". Add these contents to the file and change the name of each "Wacom..." to whatever you received as output above:

1
2
3
4
5
6
7
8
9
#!/bin/sh
xsetwacom --set "Wacom Graphire4 4x5 stylus" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 stylus" Screen_No 0x001
xsetwacom --set "Wacom Graphire4 4x5 cursor" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 cursor" Screen_No 0x001
xsetwacom --set "Wacom Graphire4 4x5 pad" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 pad" Screen_No 0x001
xsetwacom --set "Wacom Graphire4 4x5 eraser" Twinview Horizontal
xsetwacom --set "Wacom Graphire4 4x5 eraser" Screen_No 0x001

Then you'll just have to make the file executable. This could be done from terminal by issuing the command

chmod +x wacom-settings.sh

in the same directory as the file.

You could also right-click the file, select Properties > Permissions tab and check "Allow executing this file as a program".

You might either add this file to your startup applications under System > Preferences > Startup Applications (this will only work if your tablet is connected when logging in) or you could add a launcher on either your desktop or in one of your panels by dragging the file there.

This should be it. To test that the configuration really works, double click the file and click "Run in Terminal". If the tablet appears on the wrong screen, change the Screen_No above from  0x001 to 0x000.

Good luck with your notes and drawings!