I wrote a script and bound it to a key combo so I can draw a rectangle on the screen and map my drawing tablet to that area.
Future improvement: force the mapped area to the same aspect ratio as the tablet. I hope I can find a better way to programmatically get the ratio than running xinput list-devices
and parsing out “Size: 160x100mm”.
Bound via bindsym $mod+Shift+t exec ~/.config/sway/tablet-map
. Is there a better way to reference the way config directory?
You could use
${XDG_CONFIG_HOME:-~/.config}
, so if the XDG_CONFIG_HOME variable is set, it’ll use that, otherwise defaults to ~/.config.This is for the case if the user has defined a custom directory for their configs it’ll point there instead.