Ubuntu Hardy Heron (8.04) on a Toshiba Portege M400

Posted on Tue 13 May 2008 in Technology

After doing a fresh install of Ubuntu Hardy Heron (8.04) on my Toshiba Portege M400 there were some configuration changes that needed to be made.

Getting the tablet working

  1. Install the wacom-tools and xserver-xorg-input-wacom packages, if they’re not already installed:

    sudo apt-get install xserver-xorg-input-wacom wacom-tools

  2. Back-up your current, working xorg.conf file

    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.1.bkp

  3. Make the following changes to the /etc/X11/xorg.conf file:

    # xorg.conf (X.Org X Window System server configuration file)
    #
    # This file was generated by dexconf, the Debian X Configuration tool, using
    # values from the debconf database.
    #
    # Edit this file with caution, and see the xorg.conf manual page.
    # (Type "man xorg.conf" at the shell prompt.)
    #
    # This file is automatically updated on xserver-xorg package upgrades *only*
    # if it has not been modified since the last upgrade of the xserver-xorg
    
    Section "InputDevice"
        Identifier  "Generic Keyboard"
        Driver      "kbd"
        Option      "XkbRules"  "xorg"
        Option      "XkbModel"  "pc105"
        Option      "XkbLayout" "us"
    EndSection
    
    Section "InputDevice"
        Identifier  "Configured Mouse"
        Driver      "mouse"
        Option      "CorePointer"
    EndSection
    
    Section "InputDevice"
        Identifier  "Synaptics Touchpad"
        Driver      "synaptics"
        Option      "SendCoreEvents"    "true"
        Option      "Device"        "/dev/psaux"
        Option      "Protocol"      "auto-dev"
        Option      "HorizEdgeScroll"   "0"
    EndSection
    
    Section "InputDevice"
            Driver          "wacom"
            Identifier      "stylus"
        Option      "SendCoreEvents"    "true"
            Option          "Device"        "/dev/input/wacom"
            Option          "Type"          "stylus"
        Option      "ForceDevice"   "ISDV4" # Tablet PC ONLY
    EndSection
    
    Section "InputDevice"
            Driver          "wacom"
            Identifier      "eraser"
        Option      "SendCoreEvents"    "true"
            Option          "Device"        "/dev/input/wacom"
            Option          "Type"          "eraser"
        Option      "ForceDevice"   "ISDV4" # Tablet PC ONLY
    EndSection
    
    Section "InputDevice"
            Driver          "wacom"
            Identifier      "cursor"
        Option      "SendCoreEvents"    "true"
            Option          "Device"        "/dev/input/wacom"
            Option          "Type"          "cursor"
        Option      "ForceDevice"   "ISDV4" # Tablet PC ONLY
    EndSection
    
    Section "Device"
        Identifier  "Configured Video Device"
    EndSection
    
    Section "Monitor"
        Identifier  "Configured Monitor"
    EndSection
    
    Section "Screen"
        Identifier  "Default Screen"
        Monitor     "Configured Monitor"
        Device      "Configured Video Device"
    EndSection
    
    Section "ServerLayout"
        Identifier  "Default Layout"
        Screen      "Default Screen"
        InputDevice "Synaptics Touchpad"
        InputDevice     "stylus"
        InputDevice     "cursor"
        InputDevice     "eraser" 
    EndSection
    

    A copy of my xorg.conf can be downloaded from here

  4. Reboot the system, and the wacom tablet should now work

Rotating the screen

There is a bug in the compiz-core package that makes the screen not refresh after changing the orientation of the display. At the time of writing this section (5/12/08) there is a patched package for the current version, compiz-core_0.7.4-0ubuntu6. Update: This bug is still present in the compiz-core_0.7.4-0ubuntu7 package. If you update to this version rotating the screen will not work. You can download the old package, and install it with the following command:

sudo dpkg -i compiz-core_0.7.4-0ubuntu6_i386.deb

Note: this may cause package dependency issues.

Then, I created the following script as /home/derrick/bin/rotate.sh

#! /bin/sh

orientation=`xrandr -q | grep "LVDS"| awk '{print $4}' | sed 's/[^A-Za-z]//g'`
if [ "$orientation" = "normal" ]; then
    /usr/bin/X11/xrandr --orientation right
    xsetwacom set stylus rotate CW
    onboard &
else
    /usr/bin/X11/xrandr --orientation normal
    xsetwacom set stylus rotate
    killall onboard
fi

The script can be downloaded from here.

I then configured the screen rotation button on the tablet to execute the script using gconf-editor. You go to System Tools-> Configuration Editor, then in apps-> metacity, go to global_keybindings. At run_command_1, write Super_R (not 6, as in previous versions). Then in keybinding_commands, at command_1 I put the following:

sh /home/derrick/bin/rotate.sh

You’ll want to make sure that you specify the path to where the script is on your own system, and that the permissions are correct.

Check to make sure that Super_R isn’t set up as a keyboard shortcut for anything else. Now if you press the screen rotate button on the tablet it will rotate the screen and wacom input.

Getting the fingerprint scanner to work

After having gotten the fingerprint reader to work fairly well in earlier versions of Ubuntu I set out to get it configured again. In the past I was able to log in through gdm and authenticate through su/gksu (though gksu was broken at the time). Following these instructions will now allow you to log in through gdm, authenticate through su and gksu correctly, AND unlock the screensaver all by scanning your fingerprint. These directions are adapted from the Ubuntu and ThinkWiki ThinkFinger wiki pages. To my surprise, the ThinkFinger driver is packaged in Hardy.

  1. We’ll need the libpam-thinkfinger and thinkfinger-tools packages to get everything working.

    sudo apt-get install libpam-thinkfinger thinkfinger-tools

  2. Acquire a fingerprint that you will use to log in. You will need to run this as your user, and repeat this step as each user you would like to be able to log in using the fingerprint scanner.

    sudo tf-tool --acquire

  3. Test the fingerprint

    sudo tf-tool --verify

  4. Make the following change to your /etc/pam.d/common-auth file:

    #
    # /etc/pam.d/common-auth - authentication settings common to all services
    #
    # This file is included from other service-specific PAM config files,
    # and should contain a list of the authentication modules that define
    # the central authentication scheme for use on the system
    # (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
    # traditional Unix authentication mechanisms.
    #
    auth    sufficient  pam_thinkfinger.so
    auth    requisite   pam_unix.so nullok_secure try_first_pass
    auth    optional    pam_smbpass.so migrate
    
  5. Add a new group to the system

    sudo groupadd fingerprint

  6. Save the following to a new file, /etc/udev/rules.d/60-thinkfinger.rules

    #
    # udev rules file for the thinkfinger fingerprint scanner
    # 
    # gives access to the fingerprint reader to those in the "fingerprint" group
    #
    # Taken from:
    #  http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger
    # which was taken and modified from:
    #  http://article.gmane.org/gmane.linux.drivers.thinkfinger/329
    #
    
    # SGS Thomson Microelectronics Fingerprint Reader
    SYSFS{idVendor}=="0483", SYSFS{idProduct}=="2016", SYMLINK+="input/thinkfinger-%k", MODE="0660", GROUP="fingerprint"
    
    # the also-needed uinput device
    KERNEL=="uinput", MODE="0660", GROUP="fingerprint"
    
  7. Make the following changes to your /etc/pam.d/gnome-screensaver file:

    @include common-auth
    auth sufficient pam_thinkfinger.so
    
  8. For each you would like to be able to use the fingerprint scanner to unlock the screen run the following commands:

    gpasswd -a <username> fingerprint

    chown <username>:root ~/.thinkfinger.bir

  9. Reboot the system, and you should now have a working fingerprint scanner

Setting wacom tablet pen functions

I like for the eraser to act as the mouse right-click, but by default it does the same left-click as the pen tip. This functionality can be set using the following command:

xsetwacom set eraser Button1 "button 3"

This setting goes away each time the system is rebooted, unfortunately. I’ve set it be executed each time I log into gnome by adding it to the session preferences.

  1. Go to System->Preferences->Sessions under the Gnome menu.
  2. Click “Add” under Startup Programs
  3. paste the following command:

    xsetwacom set eraser Button1 "button 3"

Now when clicking the eraser on the screen the right-click menu is displayed.

Turn off IPv6

You can disable the unnecessary IPv6 traffic by adding the following line to the end of the /etc/modprobe.d/blacklist file:

blacklist ipv6

You should now at least notice that web pages load faster, as the system is no longer trying to do a IPv4 and IPv6 DNS lookup.

Enabling GSynaptics

  1. Install the GSynaptic package

    sudo apt-get install gsynaptics

  2. Edit the /etc/X11/xorg.conf file add the SHMConfig option as shown below:

    Section "InputDevice"
        Identifier  "Synaptics Touchpad"
        Driver      "synaptics"
        Option      "SendCoreEvents"    "true"
        Option      "Device"        "/dev/psaux"
        Option      "Protocol"      "auto-dev"
        Option      "HorizEdgeScroll"   "0"
        Option      "SHMConfig"    "true"
    
    EndSection
    
  3. Then log out so X restarts, and log back in. You can then select System->Preference->Touchpad to use Gsynaptics to tweak the touchpad settings.