Saturday, May 22, 2010

Configure Ubuntu 10.04 for Thinkpad X41 Tablet

Unlike previous versions of Ubuntu, Ubuntu 10.04 has xserver-xorg-input-wacom to support stylus out of box.

However, the stylus cannot rotate when we set screen rotation from system->preferences->monitor.  This causes much trouble for tablet PC users.  The problem can be solved by writing a small script to rotate both the screen and the stylus.

The biggest trouble is to find the correct name of the Wacom devices including  stylus, eraser, screen. To find the names one needs the following two commands which come with the package wacom-tools:

xsetwacom and xinput
However, the wacom-tools package available for previous ubuntu versions becomes conflicting with the built-in package xserver-xorg-input-wacom in 10.04 LTS. If we installed xserver-xorg-input-wacom first and then install wacom-tools. Then the stylus becomes un-recognizable. The following steps are what I made it:

1. Uninstall xserver-xorg-input-wacom   from synaptic package manger;

2. Install wacom-tools; Download linuxwacom-0.8.6-2.tar.bz2 and unzip it;
go to the prebuilt directory and

3. check the output of

    xsetwacom list  and xinput -list
4. Install  xserver-xorg-input-wacom   from synaptic package manger;

5.  sudo gedit rotatetablet


# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.

rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"

# Using current screen orientation proceed to rotate screen and input tools.

case "$rotation" in
#    -rotate to the right
    xrandr -o right
    xsetwacom set "Serial Wacom Tablet STYLUS"  Rotate  CW
    xsetwacom set "Serial Wacom Tablet" Rotate CW
    xsetwacom set "Serial Wacom Tablet eraser ERASER" Rotate CW 
#    -rotate to normal
    xrandr -o normal
    xsetwacom set "Serial Wacom Tablet STYLUS" Rotate NONE
    xsetwacom set "Serial Wacom Tablet" Rotate NONE
    xsetwacom set "Serial Wacom Tablet eraser ERASER" Rotate NONE
7. Save the script rotatetablet in step 6 to /usr/bin.

chmod +x /usr/bin/rotatetablet

NOTE: the names in quotations "Serial Wacom Tablet STYLUS" are obtained from step 3.

8. Make a launcher at desktop for the executable rotatetablet and use it when rotation of the tablet is needed.

6. Reboot computer. It works.


How to annotate PDF files in Linux using Xournal

One can use xournal.


Wednesday, May 05, 2010

Emission Test of my Jeep GC 2001

2007 ASM2525 E-Test    Limit (reading)
                  2500 RPM                      IDLE
HC ppm    150 (8)                            150 (6)
CO %        0.7(0.00)                         0.7 (0.00)
NO ppm    N/A                                 N/A
RPM         2334 (VALID)                727 (VALID)  
Dilution    14.60                                14.50

2010  ASM2525 E-Test    Limit (reading)

                  2525 RPM                      IDLE
HC ppm    52 (7)                            150 (4)
CO %        0.29(0.00)                     0.7 (0.00)
NO ppm    578(2)                           N/A
RPM         1373 (VALID)             738 (VALID)  
Dilution    14.40                             14.30