A collection of articles, ideas, and rambling from a guy who wrote some software that one time.

Wednesday, July 13, 2005

wacom tablet boot autodetection

This is not a tutorial for using wacom devices, just a fix for a particular problem. Maybe somebody else will run with it; the problem is now resolved to my satisfaction. It has only been tested on Ubuntu version 5.04.

I'm not liable for what you do with it. In fact, don't use it. It will harm you.


"Note that if I can get you to 'su and say' something just by asking, you have a very serious security problem on your system and you should look into it."
    - Paul Vixie, in the vixie-cron 3.0.1 installation notes


Any USB Wacom tablet owners out there running Linux? If you are, you're probably frustrated that plugging in any new devices will destabilize your tablet's event device location and make it impossible to reboot without editing your XF86Config-4/xorg.conf upon every boot.

Run this as part of your boot process, before X starts.

#!/usr/bin/python2.4

import os

def findtablet():
data = file('/proc/bus/input/devices').read().split("\n\n")

for d in data:
if 'Wacom' in d:
lines = d.split("\n")
for line in lines:
pdata = line.split('Handlers=')
if len(pdata) == 2:
for pdev in pdata[1].split():
if pdev.startswith('event'):
return '/dev/input/'+pdev


device = findtablet()
os.symlink(device, '/dev/wacom')
print 'Tablet present at /dev/wacom =>', device


Then, rather than guessing at what event device the gizmo should be every time, just put something like this into your xorg.conf

Section "InputDevice"
Identifier "stylus" # Wacom Graphics Tablet
Driver "wacom"
Option "Type" "stylus"
Option "Device" "/dev/wacom"
EndSection

1 comment:

glyf said...

Someone brought http://linuxwacom.sourceforge.net/index.php/howto/debwcmdrv to my attention - you probably want to do this that way if you are the sort of person who believes that udev works.