Skip to content

Instantly share code, notes, and snippets.

@Deevad
Created December 13, 2017 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Deevad/3a1df85a0bd4924f650ff1757e0714cf to your computer and use it in GitHub Desktop.
Save Deevad/3a1df85a0bd4924f650ff1757e0714cf to your computer and use it in GitHub Desktop.
My wacom Intuos3 A4 xsetwacom script
#! /bin/bash
# Setup xsetwacom script for Intuos 3 9x12
# License: CC-0/Public-Domain license
# author: deevad
# Tablet definition
tabletstylus="Wacom Intuos3 9x12 Pen stylus"
tableteraser="Wacom Intuos3 9x12 Pen eraser"
tabletpad="Wacom Intuos3 9x12 Pad pad"
# Reset
xsetwacom --set "$tabletstylus" ResetArea
xsetwacom --set "$tableteraser" ResetArea
#xsetwacom --set "$tabletstylus" RawSample 4
# Screen mapping and keep ratio
# xsetwacom get "$tabletstylus" Area
# default area : 0 0 60960 45720
xsetwacom --set "$tabletstylus" MapToOutput "HEAD-0"
xsetwacom --set "$tableteraser" MapToOutput "HEAD-0"
screenX=1920
screenY=1080
Xtabletmaxarea=60960
areaY=$(( $screenY * $Xtabletmaxarea / $screenX ))
xsetwacom --set "$tabletstylus" Area 0 0 "$Xtabletmaxarea" "$areaY"
xsetwacom --set "$tableteraser" Area 0 0 "$Xtabletmaxarea" "$areaY"
# ---------
# | | 1 |
# | 3 |---|
# | | 2 |
# |-------|
# | 8 |
# ---------
# button on left
xsetwacom --set "$tabletpad" Button 3 "key Control_L" # color picker
xsetwacom --set "$tabletpad" Button 1 "key KP_Divide" # '/'
xsetwacom --set "$tabletpad" Button 2 "key Shift_L" # resize brush
xsetwacom --set "$tabletpad" Button 8 "key e" # color picker
xsetwacom --set "$tabletstylus" Button 2 "key Control_L" # color picker
xsetwacom --set "$tabletstylus" Button 3 3 # color picker
@sirhaffy
Copy link

sirhaffy commented Nov 30, 2023

This looks very interesting, how do one use this code ? I am on the hunt for a fix, I want a button on the wacom to function as "Screen mapping on/off" -for the pen.
Update, just understood that this only works in *nix.

@Deevad
Copy link
Author

Deevad commented Nov 30, 2023

Hi @sirhaffy , yes it's a GNU/Linux set of xsetwacom rules (for X11). To execute them, you need to save this in a tablet.sh script, give it permission to execute, then add the script to the autostart of your desktop environment. If you are on another operating system (or use Wayland), this code will not do anything.

@sirhaffy
Copy link

Thanks @Deevad for you answer. Maby you know how I could get this functionallity in Mac / Windows ? Maby point me in the rigth direction to save me some Googling :)

@Deevad
Copy link
Author

Deevad commented Nov 30, 2023

Unfortunately, I have no idea @sirhaffy , I have only various distro of Linux at home. I guess your best option is probably the official driver from the Wacom website or I also heard about https://github.com/OpenTabletDriver/OpenTabletDriver , an alternative driver. I hope you'll succeed in your quest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment