Comment 15 for bug 216347

Revision history for this message
In , GI (gi1242+debianbugs) wrote : Re: Gtk+Perl alternative to wacomcpl

On Sun, Jan 10, 2010 at 06:24:22PM -0500, GI wrote:

> I'm attaching a Gtk+perl script that helps
> calibrating the stylus. If it doesn't get a list of devices from
> 'xsetwacom list dev', then it looks in the environment variables
> 'WACOM_*'.
>
> It also doesn't touch your ~/.xinitrc. It only saves the calibration
> parameters to ~/.calibrate.X (where X=1,2,3,4 depending on the tablet
> rotation). It's up to the user to source (or not to source) these files
> on startup. I personally automate by running
>
> WACOM_STYLUS=<name of your stylus device>
> tablet_rotation=$(xsetwacom get "$WACOM_STYLUS" Rotate)
> [[ -f ~/.calibrate.$tablet_rotation ]] && \
> source ~/.calibrate.$tablet_rotation
>
> on startup, and every time the screen is rotated.

The previous calibrate script broke with an upgrade to
xserver-xorg-input-wacom 0.10.3+20100109-1. Here's a modified version
that works. Some changes:

    1. Calibration parameters are now saved to ~/.calibrate.X where X is
       the output of "xsetwacom get stylus Rotate". In old versions this
       used to be a number between 1 & 4. In new versions it seems to be
       one of NONE, CW, CCW, HALF.

    2. Resetting calibration broke with the upgrade. This is because the
       script used "xsetwacom getdefault" to find the tablet width /
       height. Looks like getdefault is not supported with the latest
       version of xsetwacom. Instead, I use the xyDefault property to
       reset parameters, and find the tablet width/height.

GI

--
100 THINGS I'D DO IF I EVER BECAME AN EVIL OVERLORD
69. All midwives will be banned from the realm. All babies will be
delivered at state-approved hospitals. Orphans will be placed in
foster-homes, not abandoned in the woods to be raised by creatures of
the wild.