Configuring Wacom Cintiq 13HD with Ubuntu 14.04

I‘ve just replaced my old and trusty Cintiq 21UX, with a smaller and more nimble Cintiq 13HD. The reason why I’m switching has nothing to do with the quality of the 21UX, in fact it’s great for what it’s for, which is drawing, and if that was the only thing I was using it for I would have kept it. The problem is that we live in a small apartment and use the computer screen for everything, from surfing the web to streaming movies and series, as we don’t have a TV, and for that the 21UX is less than ideal as it’s always tilted a little back, and is in 4:3 format. I find 4:3 format screens great for working, but for watching movies I prefer 16:9 or 16:10.

The solution was a wall mounted 30″ Dell screen (which I got at half price because of a scratch on it), and a nice slim Cintiq 13HD that I only connect when I want to draw something.

My working table.

Before moving on to the details of actually configuring the Cintiq 13HD on Ubuntu, I wanted to mention a few of the differences between it and the 21UX, if you’re wondering which to get. Besides the obvious ones like size, there is a big difference in the thickness of the glass/acrylic. On the Cintiq 21UX and the new 24HD too (I tested it at the shop), the thickness is much greater, which means the distance between the tip of your pen when touching the screen, and the actual LCD panel is roughly 5mm, while it’s around 2mm on the 13HD. After calibrating the position of your pen, this won’t be noticeable until your either rotate the screen or move your head to the side. The more you view the tip of your pen from the side, the further away the pointer on the screen will be from the tip. This is especially annoying when you rotate the 21UX, though you do get used to it.

Secondly, the pixel resolution is quite different. The 13HD has a resolution of 1920×1080, while the 21UX is 1600×1200. The pixel density of the 13HD is 177 pixels per inch (ppi), while it’s only 94 ppi on the 21UX. This means that everything looks sharp, but small on the 13HD, when compared to the 21UX, or even my 30″ Dell which as a pixel densitiy of 100ppi. If you like this or not, really comes down to personal preference. I honestly wasn’t sure I was going to like working at such a high pixel density, and after using it for a while I’m sort of undecided on which I prefer. But enough about the 21UX, let’s get on with configuring the Cintiq 13HD.

Protect Your Screen

The very first thing you should do when getting ANY kind of Cintiq, is getting a screen protector for it. I got this one, form Photodon for mine, and used a similar one for my 21UX. The film is not really noticeable, and well worth it. Most Cintiq’s, if used enough, will begin to scratch sooner or later, no matter how careful your are, and it’s a lot cheaper to replace $15 protective film, than the front of your Cintiq.

Basic Configuration

The good news is that the Cintiq 13HD works right out of the box in Ubuntu 14.04. Just connect the cables, and it’s up and running. This alone is reason enough to upgrade, if you own a Cintiq 13HD. The Linux Wacom Project added support for the 13HD in version 0.17.0, which is now included in Ubuntu 14.04, and probably other up to date Linux distros, such as Fedora.

If you go into System Settings, and click the Wacom Tablet icon you will see the basic settings all there.

Ubuntu 14.04 Wacom Settings

You can adjust what the pens rocker button does, tweak the pressure softness/firmness, calibrate the pen position and map the buttons on the left hand side of your screen. This may very well be all you need to configure your Cintiq 13HD to your liking.

Pen Calibration

You may need to calibrate the position of the pointer, if you find it’s not matching the tip of the pen exact enough. To do this simply hit the “Calibrate…” button, and follow the on screen instruction, clicking on the targets with your pen. Try to keep your head in the position you would normally have it when drawing during the calibration, as part of what you are doing is calibrating the position of the pointer relative to the tip of the pen and your line of sight. You can redo this process as many times as you want, to get an exact result.

Mapping the Tablet Buttons

The Cintiq 13HD has a number of buttons on the side, which can be mapped to different functions. Just hit the “Map Buttons…” button. They can either be set to “Show Onscreen Help”, which displays what all the buttons are set to, or to different keyboard shortcuts such as Ctrl-z. The buttons are listed from 1 to 9, and map to the actual buttons like so.

wacom-pen-mapping

While this is all great, there are a couple more features that I wanted that were not available from the interface.

Mapping Modifier Keys

One of the limitations of the Wacom Tablet settings panel, is that it can’t map modifier keys, such as Ctrl, Shift or Alt, to one of the buttons. It can map a modifier key plus a keystroke, such as Ctrl+z, but not a modifier key alone. Programs like GIMP, Krita and MyPaint, all use modifier keys with mouse clicks for handy things like rotating the canvas, picking color and more. To get around this you can create a small script that maps these keys. The command used for this is “xsetwacom”. Here are a few examples.

xsetwacom set "Wacom Cintiq 13HD pad" Button  1 "key +ctrl z -ctrl"
xsetwacom set "Wacom Cintiq 13HD pad" Button  9 "key +ctrl"
xsetwacom set "Wacom Cintiq 13HD pad" Button 10 "key +bracketright"

The command is relatively simple, but there are a couple of things worth explaining. The first line maps button 1 to Ctrl+z. The +ctrl and -ctrl, mean hold down ctrl, and release ctrl. This is needed when ctrl, shift or alt, is combined with a key.

The second line simply maps the ctrl key to button 9.

Finally the thrid line defines a special sign the “]” key. Rather than enter in ], we need to use the name of the key or we would get the folowing error: “Invalid key ‘+]’.” Other such keys include: plus, minus, backspace and more. I also added the plus sign in front, as I use the key to increase brush size, and with the plus sign I can hold the key down to get key repeats, rather than pressing it multiple times when I want to increase the brush size a lot.

If you looked carefully, you may have noticed, that the last line refers to Button 10, which doesn’t exist in the illustration above. This is because the buttons are numbered slightly differently when referring to them with xsetwacom.

xsetwacom button mapping on Cintiq 13HDYou can combine these commands with the ones in the Wacom settings, if you just have a couple of modifier keys you want to map, or you could do like me, and just create a script that maps all the buttons.

Mapping Buttons Using xsetwacom on Login

While the above commands are nice, you probably don’t want to run them manually every time you log in to your computer. So we want to combine them into a script. Mine looks like this:

#!/bin/bash                                                                                                                              
xsetwacom set "Wacom Cintiq 13HD pad" Button  1 "key +ctrl z -ctrl"

xsetwacom set "Wacom Cintiq 13HD pad" Button  2 "key +super z -super" # Toggle screens                                     
xsetwacom set "Wacom Cintiq 13HD pad" Button  3 "key +super w -super" # Spread Windows     

xsetwacom set "Wacom Cintiq 13HD pad" Button 10 "key +bracketright"   # Bigger brush                                                   
xsetwacom set "Wacom Cintiq 13HD pad" Button 11 "key plus"            # Zoom in                                                          
xsetwacom set "Wacom Cintiq 13HD pad" Button 12 "key +bracketleft"    # Smaller brush                                                    
xsetwacom set "Wacom Cintiq 13HD pad" Button 13 "key minus"           # Zoom out                                                         

xsetwacom set "Wacom Cintiq 13HD pad" Button  8 "key +shift"
xsetwacom set "Wacom Cintiq 13HD pad" Button  9 "key +ctrl"

You need to save this to a text file using a text editor (Text Editor or gedit works fine), and make it executable. So save this out as “wacom-buttons”, and make the file executable. In the file browser (Nautilus), right click the file and choose Properties, then under the Perimssions tab, check the “Allow executing file as program” checkbox. If you prefer the command line, simply run “chmod a+x wacom-buttons” on the file.

Secondly you need to place the script in PATH, where the system can find it. On Ubuntu this would be either in /usr/local/bin/ for system wide scripts, or in /home/YOU/bin for scripts only available to one user. Either works fine. To place it in /usr/local/bin/ you need super user access, like so “sudo cp wacom-buttons /usr/local/bin/.” Once this is done, you can open a new terminal and enter wacom, and hit tab a couple of times, and it should autocomplete to wacom-buttons.

Finally, to get it to run at every startup we simply need to add it to startup applications. Simply hit Super+a (Super is the key with the logo of that other big commercial OS on it on most keyboards), and enter Startup. wacom-startup-settingsThis should show you the “Startup Applications” program. In the Startup Application Preferences hit the Add button, and fill in the fields. Enter the full path to your wacom-button script in the Command field, and enter whatever you want in Name and Comment.

That’s it. Now every time you log in, your keys will be mapped correctly. Although, note that the Cintiq 13HD must be connected when you log in for this to work. If you connect the screen after logging in, or modify your wacom-buttons script, you will need to manually run the script again either from the terminal or by double clicking it.

Jumping Between Screens

Most likely your Cintiq is not your only screen, and you may want to move the pointer to your other screen using your Wacom pen, effectively making your Cinitq 13HD work as a rather expensive ordinary tablet. To this end, I wrote a little script that lets you toggle which screen your Wacom is mapped to.

#!/bin/bash
#
# Toggles which screen the cintiq is mapped to.
if [ `cat ~/.wacom-mapping` -eq 0 ];
then
    echo 1
    xsetwacom set "Wacom Cintiq 13HD stylus" MapToOutput "HEAD-1"
    xsetwacom set "Wacom Cintiq 13HD eraser" MapToOutput "HEAD-1"
    echo 1 > ~/.wacom-mapping
else
    echo 0
    xsetwacom set "Wacom Cintiq 13HD stylus" MapToOutput "HEAD-0"
    xsetwacom set "Wacom Cintiq 13HD eraser" MapToOutput "HEAD-0"
    echo 0 > ~/.wacom-mapping
fi

Like with the wacom-buttons script previously, you need to write this to a file, make it executable and put it in PATH. I’ve called mine wacom-toggle-mapping, and put it in /usr/local/bin/.

The script is rather primitive, and doesn’t take all eventualities into account. It works with two screens, using an Nvidia graphics card. I’m not sure if AMD or Intel refer to their screen outputs as HEAD-0 and 1, so please let me know if you get this working on a different setup.

With the script in PATH, you can set up a keyboard shortcut, to quicky jump between the screens. To do this go into the Keyboard settings in the System Settings, and under the Shortcuts tab, select Custom Shortcuts. Hit the + sign at the bottom of the window, and similarly to adding startup applications, you enter the Name and Command you want to run. I’ve assigned mine to Super+z, as I figured it wasn’t being used for anything else, but you can assign it to whatever key combination you prefer.

As you may have noticed, I’ve also mapped Button 2 on my tablet to Super+z, so I can use that to quickly toggle between screens. Now you no longer need to use the mouse to access your other screen.

Adjusting Colors and Brightness

Wacom made a rather weird decision to not include any controls on the screen itself for adjusting the brightness, contrast or other screen settings. They put this in the Windows and Mac Wacom drivers, which is not that great for us Linux users, as Wacom doesn’t make a Linux driver for any of it’s products, and the Linux Wacom Project focuses on the tablet part of Wacom products, not the display. If you’re using the commercial Nvidia driver, you’ll find that in NVIDIA X Server Settings you can adjust the brightness and contrast if you want to, and I’m sure AMD/ATI has something similar in their driver.

To verify that I was getting the colors I wanted I borrowed an X-Rite i1 calibrator from work, and used Dispcal GUI to calibrate the Cintiq. Color theory and color calibration is a huge and complex subject all of it’s own, so I won’t go into much details here, but only present the results.

The brightness of the screen is relatively dim. I try to aim for 120cdm², and the brightness of the Cintiq 13HD was only a little over 80cdm². Though, for a screen that you’ll likely be looking at from a relatively short distance when drawing, this may actually be an advantage.

Wacom Cintiq 13HD Color GamutThe above illustrations shows the color gamut the Cintiq is able to display, compared to two commonly used color spaces, Adobe RGB and sRGB. A screens gamut defines the most intense colors it can display. The colored line is the result from my Cintiq 13HD, while the dotted lines indicate the AdobeRGB and sRGB gamut, as labeled. The visible spectre is the color gamut our eyes can visibly detect, which is quite a bit outside what any screen I know of can display.

The Cintiq 13HD will work fine for working with sRGB images, which is what most computers, operating systems and the web is using. If, on the other hand, you are using a color managed workflow and working with wide gamut colors, like many photographers do, you’ll need a second good quality display to check your work on, as the Cintiq 13HD simply won’t be able to display those intense colors.

What’s Next

You should now have a fully functional Cintiq 13HD with your Ubuntu, and you can get on with drawing and painting. But before you do, you might want to check out Easystroke Gesture Recongition (you’ll find it the Ubuntu Software Center). I wrote a tutorial on using Easystroke with GIMP back in 2009, that’s ripe for an update, but you should get the general gist of the power of using gestures with tablets from it.

May 3, 2014

28 responses to Configuring Wacom Cintiq 13HD with Ubuntu 14.04

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.