Map Wacom Tablet to Monitor in Wayland using Sway

I have been trying out Wayland and since I have a dual-monitor setup my Wacom Iotus Draw tablet is practically unusable by default because the usable rectangle on the tablet stretches across both monitors.

In Xorg I used xsetwacom's MapToOutput to map it to my primary monitor, which doesn't work on wayland, however you can achieve the same directly through sway.

First you need to find the identifier of your tablet's pen:

$ swaymsg -t get_inputs
Input device: Wacom Intuos S 2 Pen
  Type: Tablet tool
  Identifier: 1386:827:Wacom_Intuos_S_2_Pen
  Product ID: 827
  Vendor ID: 1386
  Libinput Send Events: enabled

Here mine is 1386:827:Wacom_Intuos_S_2_Pen. Then find the name of your monitor:

$ swaymsg -t get_outputs
Output DP-3 'BenQ Corporation BenQ GW2480 R8J0129201Q' (focused)
  Current mode: 1920x1080 @ 60.000000 Hz

Here it is BenQ Corporation BenQ GW2480 R8J0129201Q. Then simply tell sway to map the tablet to the monitor:

$ swaymsg 'input "1386:827:Wacom_Intuos_S_2_Pen" map_to_output "BenQ Corporation BenQ GW2480 R8J0129201Q"'

If you want to make this permament simply add everything within the single quotes to your sway config.