Skip to content

Repository files navigation

tabletsettings

Calibrate a wacom tablet to a screen or window, on sway or X11.

The compositor backend is chosen automatically when compiling: building inside a sway/wayland session produces the sway backend (driven through swaymsg), building inside an X11 session produces the X11 backend (driven through xsetwacom). Set TABLETSETTINGS_BACKEND=sway or TABLETSETTINGS_BACKEND=x11 before building to override the detection.

Features

  • Map a tablet to a monitor or to an application window
  • Keep the tablet's aspect ratio by shrinking its active area to match the target
  • Rotation (left/right-handed on sway; none/90°/180°/270° on X11)
  • Absolute (pen) or relative (mouse) tracking mode
  • Map functions to the pad's ExpressKeys: pan/scroll, zoom, undo/redo, copy/paste, mouse clicks, modifier keys, and more. On X11 this goes through the wacom driver; on sway it is performed by the bundled pad key daemon (see below)
  • Settings are saved and re-applied every time the app starts

Usage

Devices, monitors, and windows appear exactly as you'd expect it to. This is done automatically. Select a device and either a monitor or window to map the tablet to. If you wish to keep the aspect ratio, select the checkbox for that and it will adjust the width or height on the tablet to keep the aspect ratio.

Because sway is a tiling window manager, it's better to set the app as a floating window if the application you want to set it to is in the same monitor.

Settings applied from the window are saved and re-applied on the next launch. To restore them at login without opening the window, run:

tabletsettings --apply

for example from your sway config:

exec tabletsettings --apply

Pad keys on sway

Sway cannot remap pad keys itself, so on sway the key functions selected in the window are performed by a small daemon that reads the pad's key presses directly and emits the mapped keystrokes through a virtual keyboard. Set it up once after installing:

# Allow your user to read input devices and create virtual ones
sudo usermod -aG input $USER
sudo udevadm control --reload
# Log out and back in for the group to take effect, then:
systemctl --user enable --now tabletsettings-daemon

The daemon watches the config file, so clicking Apply in the window takes effect immediately. Check its status with:

journalctl --user -u tabletsettings-daemon

Notes:

  • The daemon only takes over the pad while at least one key has a function assigned. While it does, applications that handle pad keys natively (such as Krita) will not see them; clear the key functions and Apply to give the pad back to them.
  • On X11 the daemon is not needed and the service does nothing; key mappings are applied through the wacom driver directly.

Alt text

Alt text

Dependencies

  • libwacom
  • gtk4
  • meson
  • ninja
  • rust
  • pkgconf (base-devel)

On sway:

  • sway (swaymsg)

On X11:

  • xf86-input-wacom (xsetwacom)
  • xrandr
  • wmctrl

Installation

AUR

https://aur.archlinux.org/packages/tabletsettings-git/

Manually

git clone https://github.com/avargas05/tabletsettings.git
cd tabletsettings
meson setup --buildtype release --prefix /usr bin
ninja -C bin
sudo ninja -C bin install

About

Calibrate Wacom device on sway

Topics

Resources

Stars

12 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages