(continued)
3. Hotplugging
If your tablet(s) are not always connected (e.g. laptop), X.org will crash if it doesn't find the tablet already connected at boot time. To work around this problem, you need to install wdaemon - it will fake the presence of a tablet to X.org and the latter won't crash if the tablet is not physically there.
Unfortunately, the daemon is still in fairly early stages of development and will need some "encouragement" to get it installed on Fedora. This is applicable to my Fedora 7 install, doesn't seem to be an issue in FC6. All the same, it's pretty simple.
a. Create a work directory somewhere (I'll use "/home/user/wdaemon" as an example) and cd into the new directory.
b. Get the latest source code:
Code:
svn co https://jake.ruivo.org/wdaemon/trunk/ .
Note, SVN will complain that the security certificate could not be verified - just accept it temporarily.
c. Compiling wdaemon for Fedora Core 6 (Fedora 7 users use next step, instead):
FC6 is slightly different and has uinput in a different directory. You can double-check it by running
Code:
# modeprobe uinput
$ find /dev -name uinput
If the last command returned "/dev/uinput" (and it should have), then you should compile wdaemon like so:
Code:
$ make UINPUT_FILE=/dev/uinput
Note: if you already compiled without this flag and are getting an error ("Unable to open uinput file /dev/input/uinput: No such file or directoryError adding device") - run this before running the make command above:
d. Compiling wdaemon for Fedora 7 (Fedora Core 6 users skip this step):
e. The installer doesn't install everything we need, so let's just copy over the files manually.
Note: there used to be a part here about modifying is_unput.sh here. As far as I can tell, this is no longer necessary - you can just use the original file.
Let's go back to the command line and install the daemon:
Code:
# cp wdaemon /usr/bin/
# mkdir -p /etc/udev/scripts/
# cp udev/is_uinput.sh /etc/udev/scripts/
# cp wdaemon.initrd /etc/init.d/wdaemon
# chkconfig --add wdaemon
# chkconfig --levels 345 wdaemon on
I've had a strange issue where the uinput device is not created for some reason during bootup. I think it's some kind of timing issue in the script /etc/init.d/wdaemon
If you see that your X session doesn't start (mine kept saying something like "gdm appears to be crashing. trying another one."), add this to /etc/init.d/wdaemon line 40 (right before `echo -n $"Starting $prog: "`):
This will slow down the starting sequence by a second, but the problem goes away. I'll try to find a better solution in the future 
f. You now need to add config files for wdaemon
The details are available in the README file that comes with wdaemon source code. Here's the most likely needed part:
- Run and find the model IDs for all your tablets.
- Create a file /etc/wdaemon.conf (as root, since /etc should not be writable by normal user)
- Add the following line for every tablet device you have:
Code:
device = N,/dev/input/wacom
where N is the tablet model ID (as found earlier), and /dev/input/wacom is the path to that tablet's symbolic link. This is the same symlinks as created in step #2 - if you skipped that step, it should just be /dev/input/wacom.
Note: wdaemon config file parser is very particular about the syntax (not advanced enough to know any better), so to be on the safe side, don't add any extra spaces/comments/etc. into the config file.
g. Add symlinks for the uinput devices
For each device type (tablet model) that you'll be hotplugging, get the Product ID:
Code:
$ cat /proc/bus/input/devices
Look for the tablet device (looking for "Wacom" works) and get the Product=X
Then, add the following line to /etc/udev/rules.d/21-uinput-wacom.rules:
Code:
KERNEL=="event*", PROGRAM="/etc/udev/scripts/is_uinput.sh", RESULT=="056a-X", SYMLINK="input/uinput-wacom"
X is the Product ID of the tablet model (you just got it earlier), and input/uinput-wacom is the symlink you want to use. If you only have one tablet, you can leave it as is; otherwise, append the model name to the name.
Here's what my /etc/udev/rules.d/21-uinput-wacom.rules looks like:
Code:
# udev rules for uinput wacome devices
# will create:
# /dev/input/uinput-<model>-tabletX
#
KERNEL=="event*", PROGRAM="/etc/udev/scripts/is_uinput.sh", RESULT=="056a-0015", SYMLINK="input/uinput-wacom-graphire4-4x5"
KERNEL=="event*", PROGRAM="/etc/udev/scripts/is_uinput.sh", RESULT=="056a-0043", SYMLINK="input/uinput-wacom-intuos2-9x12"
h. Start wdaemon
Code:
# service wdaemon start
4. X.org configuration
Apply each of the following to each of your tablets (i.e. you'll need to insert this config code multiple times if you have more than one tablet)
Edit your X.org configuration file (/etc/X11/xorg.conf) as root.
Add the following to the section of the file where you have other InputDevice entries:
Code:
Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/ttyS0" #SERIAL ONLY
Option "Device" "/dev/input/wacom" #USB ONLY
Option "Type" "stylus"
Option "USB" "on" #USB ONLY
Option "ForceDevice" "ISDV4" #Tablet PC ONLY
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/ttyS0" #SERIAL ONLY
Option "Device" "/dev/input/wacom" #USB ONLY
Option "Type" "eraser"
Option "USB" "on" #USB ONLY
Option "ForceDevice" "ISDV4" #Tablet PC ONLY
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/ttyS0" #SERIAL ONLY
Option "Device" "/dev/input/wacom" #USB ONLY
Option "Type" "cursor"
Option "Mode" "relative"
Option "USB" "on" #USB ONLY
Option "ForceDevice" "ISDV4" #Tablet PC ONLY
EndSection
Make sure to read the comments in this code and to comment out the lines which don't apply to you. For example if you have a USB tablet, make sure you comment out lines that say #SERIAL ONLY and #Tablet PC ONLY
If you have Intuos3, Cintiq 21UX, Graphire4, or Bamboo you also need to add the pad:
Code:
Section "InputDevice"
Driver "wacom"
Identifier "pad"
Option "Device" "/dev/ttyS0" #SERIAL ONLY
Option "Device" "/dev/input/wacom" #USB ONLY
Option "Type" "pad"
Option "USB" "on" #USB ONLY
EndSection
Note that you'll need to reference your own device symlinks. If you used hotplugging, they'll be /dev/input/uinput-wacom...; if you don't have hotplugging, it'll be whatever you set the symlinks to (#2) - or it'll just be /dev/input/wacom.
Modify the ServerLayout section to include your new entries:
Code:
Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "stylus" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents" # For non-LCD tablets only
InputDevice "pad" # For Intuos3/Cintiq 21UX/Graphire4/Bamboo tablets
EndSection
Again, if you have multiple tablets (or use hotplugging with one of the multiple tablets of different models), you need to add each type to xorg.conf
After this is done, restart X by logging out and then back in (assuming you only have one login session running). Reboot the computer if you really want