← Back to the archive

Setting a Wacom tablet to a specific monitor on Linux (Debian and Ubuntu)

I used to draw with a tablet , but nowadays I got back into using only pencil and paper.

Here I show how to quickly configure your Wacom tablet to be assigned to only a specific monitor display in a multi-monitor setup.

Dependind of which Desktop Enviroment you use in your Linux system, configuring a Wacom tablet can be a hassle if you don't know what you are doing. While KDE Plasma and Cinnamon both have easy GUI applications that can be used to configure this, most other Desktop Enviroments such as XFCE and basically any Window Manager requires you to manually set the specific configuration you'd want.

That's why you should create a simple shell script and run it every time you plug your tablet to your machine, check it out:

Note: this guide is meant for Desktop Enviroments running on X11

In this example I will use my old Wacom Bamboo Pad. but first we need to install some packages if your Linux distribution doesn't include them by default:

  • libwacom (library)
  • xf86-input-wacom (X.Org tablet driver)
  • If you're using Arch, there is xwacomcalibrate avaliable via the AUR. This package does the very same thing the script that I'm gonna show below does, so you can use it too if it works better in your case.

    With this done, we need to know how both the Tablet and Monitor are named on the system, this can be done via the command line.

    For the display we use the command xrandr --listmonitors

    In this case, eDP-1 is the name of my laptop's screen, while DP-1 is the name of my external display.

    And for the tablet we use xwacom --list devices | (you will need to plug your tablet in so that it can be listed)

    Having this information we can use any text editor and write a simple shell script to assign the device to a specific display using the xsetwacom command:

    xsetwacom --set "[YOUR TABLE NAME]" MapToOutput [YOUR MONITOR NAME]

    Depending of which tablet you have you will need to assign more than one "device" in this script. For example, in my case I have to set both the stylus and the "eraser", since they are seen as two different thing by the system.

    After saving it as a .sh file, run it with via terminal with your device plugged-in and it should limit the mouse cursor only to the desired display bounds when using the tablet. Note that you will need to run this script every time you boot your machine since this configuration will be reset after the system shuts down or you end the user session.

    And that's it! Of course that you could also write a more complex script that activates automatically only when you plug your device, but for a quick fix what I've showed here should be enough.

    Back to top