Ubuntu Linux 5.10 Breezy Badger on an IBM ThinkPad T42


First steps

Introduction | What not to do

Installation 

Basic installation guidelines | How to install to the second hard disk adapter | Enable additional repositories for the update manager | Install a kernel for your Pentium 4 CPU

Hardware setup

Fix a possible hibernation problem | Enable TrackPoint middle-button scrolling | Improve power management | Enable Page-Back and Page-Forward keys in Firefox | Change CPU frequencies easily | DMA problems | ThinkPad Dock II

Networking

Don't slow down boot-up by synchronizing with network timeInstall NetworkManager for effortless networking | Install Bluetooth support | Install a modem driver

Using the ThinkPad buttons

 Install on-screen confirmation for the ThinkPad buttons (other than Fn+F5) | Visual feedback for Fn+F5 | Use Fn+F6 to toggle Bluetooth

Other ThinkPad-related software

Gaim-ThinkLight


Warning: This guide is not designed for Ubuntu Linux 6.06 Dapper Drake and was not tested with Dapper Drake. Do not use the advice on this page when installing Dapper Drake unless you find independent confirmation for it. I do not know whether the advice on this page will help or hurt a Dapper installation. Dapper seems far too buggy to use on a ThinkPad T42; I have removed it from my system; and I will not post any advice on using it (except for this advice: Maybe you should wait for the next version).


First steps


Introduction

This page is based on Ubuntu Linux 5.10, the "Breezy Badger" release, on an IBM/Lenovo ThinkPad T42, model 2373 H6U, a model with an ATI Mobile Radeon 9600 video chip and 1400x1050 display, the IBM/Atheros wireless mini-PCI card, Bluetooth, and the fingerprint sensor. I have also included notes on my experience with an older model, the 2373 JTU, with an ATI Mobile Radeon 7500 video chip and 1024X768 display, the IBM/Atheros wireless mini-PCI card, but no Bluetooth and no fingerprint sensor.

I have not tested the infrared features of the ThinkPad T42. Preliminary support for the Hard Disk Active Protection System under Linux may be tracked on this page, but is not yet available for actual use. Preliminary information on the fingerprint reader may be found on this ThinkWiki page and in this thread.

The information here is based on my own experience, supplemented by many other web pages, message postings, and wiki entries, and, above all, the helpful and detailed postings at http://www.ubuntuforums.org; I have noted sources for specific items below. Note that most of the fixes and adjustments that were required with Ubuntu 5.04 Hoary Hedgehog are no longer required with 5.10 Breezy Badger, and that most of the material on my page about Ubuntu 5.04 Hoary Hedgehog on a ThinkPad T42 does not apply to Breezy Badger!

This page was compiled by Edward Mendelson. Please send any corrections to emendelson-at-compuserve-dot-com, or post them for everyone to see in this thread at ubuntuforums.org. (Revised 29 October 2005 with additional details on disabling and enabling ntpdate at bootup; revised 30 October 2005 to recommend laptop-mode-tools instead of noflushd, to allow Fn+F6 to work after sleep or hibernation, and to add the Other ThinkPad-related software section; revised 1 November 2005 to simply the Fn+F6 steps and other details; revised 10 November 2005 to include J. Kraemer's elegant solution to the OSD problem.)


What not to do

If you search the net for information on Ubuntu or other Linux distributions on an IBM ThinkPad T4x, you will find many pages that present or repeat information that is (a) obsolete, (b), irrelevant, (c) dangerous, or (d) some combination of the preceding three. This section is a list of things that you should not do, even though other pages tell you that you should.

Do not recompile your kernel. There is absolutely no need to recompile the Linux kernel to work with any power-management or other feature on the ThinkPad. You will improve performance by installing the Ubuntu kernel for 686 systems. No further changes in the kernel are necessary. However, if you can't sleep until you recompile your Linux kernel, here is a page with up-to-date advice on recompiling the Breezy kernel for an IBM ThinkPad.

Do not modify the file /etc/default/acpi-support except where stated on this page. Hibernation (suspend to disk) and sleep (suspend to RAM) are both supported automatically by Ubuntu Breezy.

Do not add "pci=noacpi acpi_sleep=s3_bios" anywhere in /boot/grub/menu.lst. Ubuntu Breezy does not need the first of these strings and ignores the second.

Do not add "resume=/dev/xxx" (where "xxx" is the name of a partition) anywhere in /boot/grub/menu.lst. Ubuntu Breezy does not need this string and works perfectly without it.

When installing the tpb (ThinkPad buttons) program, do not make any modifications to your system other than those described below. Do not try to modify the file /etc/udev/permissions.d, partly for the excellent reason that Breezy does not use this file, and the file should not even exist on your system.

Do not try to install tpctl or configure-thinkpad or thinkpad-base or thinkpad-source; they are useless on recent ThinkPad models such as the T42 because they are designed to work with the older apm power-management system, not the advanced acpi system. They won't even install in Ubuntu Breezy. (They may work with older models such as the T20, but I haven't tried this.)

Do not try to install configure-trackpoint unless you are willing to patch the Linux kernel to install the driver that the program requires.

Do not install ifplugd and do not disable hotplug; these steps are not necessary. Instead, use the instructions on this page for installing and using NetworkManager.

Do not modify anything that concerns powernowd. You will probably gain nothing, and you may cause damage to your system.

Do not install the fglrx driver for the ATI Radeon video hardware unless you absolutely need 3D acceleration; the fglrx driver makes it impossible to use the suspend or hibernate features on your system. Update: this blog post claims to have got suspend working with the fglrx driver; I have not tested this. Further update: This site has prepackaged fglrx drivers that are reported to support hibernation but not not suspend-to-RAM (sleep); see various postings on ubuntuforums.org for further details.


Installation


Basic installation guidelines

Do not upgrade an existing 5.04 Hoary Hedgehog installation; your system will almost certainly not work correctly, and many configuration files will have settings that will cause problems. If you do not have your home directory on a separate partition (which you can leave untouched during a new installation), copy it to a safe place, perform a clean installation, and copy it back.

Note that the instructions on this page cover two kinds of installation: (1) installing Ubuntu on a hard disk where you no longer want Windows XP at all, and (2) installing Ubuntu on the second hard disk adapter while keeping Windows XP on the internal hard disk (dual-booting between two hard disks). This means I cannot offer any advice on dual-booting with Windows XP and Ubuntu on the same internal hard disk while also preserving the IBM Rescue and Recovery Partition and the F11 function that opens it; I would guess (but it is only a guess) that the way to do this is to install Ubuntu on a bootable primary partition and install Grub to the boot sector of that partition, which may have a name such as /hda3 or /hda4 or something similar, but that is only a guess, and you should not attempt it without checking many other sources before trying.

When installing Ubuntu Breezy from the CD, you may accept most of the default settings. Two manual settings are important

First, when partitioning your hard disk, give Ubuntu a swap file partition larger than the amount of memory in your ThinkPad; if you have 1 GB of RAM in your ThinkPad, make the swap file at least 1.25 GB in size. Also, I strongly advise creating a separate partition for your home directory. You will almost certainly want to perform a clean install when the next version of Ubuntu appears, and the easiest way to do this is to have a separate partition for your home directory.

Second, the installer menu headed “[!] Install the GRUB boot loader on a hard disk” will suggest that you install the Grub bootloader on the Master Boot Record (MBR) of your first hard disk. Do not agree by clicking <Yes>; instead, choose <No>, and, on the next screen, install Grub in the first partition of the disk on which you install Ubuntu (typically /dev/hda1 on a fresh install, or, if you install on a disk in the second HDD adapter, /dev/hdc1).

If you make a mistake while installing, and you no are no longer able to start the IBM Rescue and Recovery partition during bootup, use the repair diskette downloadable from this page to repair or restore your Master Boot Record.

After installing, immediately use System | Administration | Update Manager to install all updates available for your system.


How to install to the second hard disk drive adapter

I wanted to install Linux to the second hard disk while keeping my original Windows XP system on first (internal) hard disk - and I wanted the Linux installation to leave my Windows installation and its disk entirely untouched. My goal was to have the system work in this way: (1) If only the internal hard disk was present, I wanted the computer to boot normally into Windows XP; but (2) If the internal hard disk and the second hard disk were both present, I wanted a boot menu that would let me choose whether to boot to Linux on the second hard disk or to Windows XP on the internal hard disk. Here is one way to achieve this (but see the Note at the end of this section for another way):

In addition to the second hard disk drive adapter (with a disk inside it), you will need to use either a USB optical (CD or DVD) drive or an optical drive installed in the ThinkPad Dock II. Any standard USB CD or DVD drive should work perfectly, .

Follow the basic installation guidelines above. When the installer offers to install the Grub bootloader in the MBR of the first hard disk, choose No, and instead install it to /dev/hdc1 - which is the first partition of your second hard disk. (If you intend to keep the second hard disk drive adapter permanently in your system, it may make sense to install Grub on the MBR of your first hard disk, but it's safer not to.) Let the installation continue until the end; reboot your system.

When the system starts up again, either press F12 to bring up a menu of boot devices, or change your  BIOS startup options so that you boot by default from the second HDD. Grub will start up and offer to boot Linux. Do not press Enter to boot, because you will not be able to boot into Linux. Instead, press "e" to edit the command sequence, highlight the line that reads "root (hd1,0)", press "e" to edit the line, and change it to read

root (hd0,0)

Press Esc to return to the menu, then press "b" to boot and Ubuntu should boot normally. To avoid having to perform this manual step every time you boot, do the following as soon as Ubuntu displays the desktop: Go to the top-line menu, use Applications | System Tools | Terminal, and enter these two commands (you may be prompted for your password):

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst-original
sudo gedit /boot/grub/menu.lst

Edit the menu.lst file to replace all instances of "root (hd1,0)"to

root (hd0,0)

Two lines beneath "## default grub root device" make sure to change the entry "# groot=(hd0,0)" to read:

# groot=(hd1,0)

Toward the bottom of the file, you will find one or two entries in the list that are designed to boot Microsoft Windows. The one that launches Windows XP will look like this:

title Microsoft Windows XP Professional
root (hd0,0)
savedefault
chainloader +1

Edit the file so that it looks like this instead - and be sure to notice the change from "root (hd0,0)" to "root (hd1,0)", the two added lines, and the commenting-out of the "savedefault" line by adding the # character at the front::

title
Microsoft Windows XP Professional
root (hd1,0)
map             (hd0) (hd1)
map             (hd1) (hd0)
#savedefault 
chainloader +1

This may be preceded by an entry that looks like this:

title Windows NT/2000/XP
root (hd0,1)
savedefault
chainloader +1

This entry is the entry for the IBM Rescue and Recovery Partition. I have not figured out a way to make it boot from a copy of Grub installed in the second hard disk, so comment out the entire entry by placing the # character at the front of each line, like this:

#title Windows NT/2000/XP
#root (hd0,1)
#savedefault
#chainloader +1

Save the file and close the editor. I strongly recommend that you do not use the sudo grub-update command that most guidelines recommend at this point. Reboot your ThinkPad, again pressing F12 to select the second hard disk as your boot disk if necessary, and test your changes.

Note: I have not tried an alternate method which involves temporarily replacing the internal hard disk with the disk on which you want to install Linux; that method is reported to work, but I would not attempt it, because Ubuntu uses more than one obscure file to store the identify the partitions on which it is installed, and these files will point to the wrong partitions after you move the disk. If you do use this method, however, you must install Ubuntu to /dev/hda1 and when the installation is complete, and when you have removed the drive and placed it in the second HDD adapter, and restored the original internal drive, you should proceed as described above, starting with the paragraph that begins "When the system starts up again".

Source for this item: Extensive experimentation, based on various online manuals for Grub.


Enable additional repositories for the update manager

One of the first things to do after Ubuntu boots normally from its Grub menu is to enable to additional repositories for downloadable software.

Ubuntu uses the Synaptic Package Manager (System | Administration | Synaptic Package Manager) as the GUI-based means of installing new software. To make Synaptic easier to use, turn off the option that asks for the installation CD when adding packages and turn on the option that downloads "universe" packages that are not fully supported by Ubuntu, but which are more or less essential for a finely-tuned computer. You can perform this task in the Synaptic program itself (under Settings | Repositories | Edit), but you get more control by using a text editor to edit the list of sources. Open a terminal, and enter these commands:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo gedit /etc/apt/sources.list

The top line of the file may begin something like this: deb cdrom:[Ubuntu etc. If you don't want to insert the CD each time you update your system, comment this out by inserting the # character at the front of the line.

Next, remove the # character from the front of each line (except the top line described in the previous paragraph) that begins deb http: or that begins deb-src http: Save the file and close the editor. In the terminal, enter this line:

sudo apt-get update


Install a Linux kernel for your Pentium 4 CPU

In the Gnome menu, use System | Administration | Synaptic Package Manager, and search and install the two packages linux-686 and (while you are here) build-essential. The first of these installs the version of the kernel that specifically supports Pentium 4; the second provides essential files for “building” other programs if necessary. Reboot. The 686 kernel should be at the top of the list of boot options. Boot into it.


Hardware setup


Fix a possible hibernation problem (ATI 7500 video hardware only)

On my ThinkPad with the ATI 9600 video hardware, Ubuntu Breezy handles hibernation and suspend-to-RAM correctly as soon as it is installed. You do not need to do anything to make it work. The standard hotkeys will work correctly: Fn+F4 suspends to RAM (sleeps); Fn+F12 suspends to disk (hibernates).

However, only if you have an ATI 7500 video chip in your ThinkPad, your computer will not wake successfully from hibernation until you make one small change. In a terminal, enter:

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst-backup
sudo gedit /boot/grub/menu.lst

and use the Ctrl-F (Find) feature to remove every instance of the word splash from the file. No matter what you read elsewhere, do not add anything that begins vga=, because the vga= or the splash parameters will prevent your Thinkpad from waking from hibernation. Remember, this applies only to systems with the ATI 7500 video hardware. These steps are not necessary for the ATI 9600.

To suspend to RAM (sleep), press the ThinkPad’s sleep button (Fn+F4). To wake up the system from sleep, press the Fn key and wait a few seconds.

To suspend to disk (hibernate), press the ThinkPad's hibernate button (Fn+F12), or use the option to hibernate the computer on the logout menu. Press the power button to wake the system; the desktop should reappear automatically.

Source for this item: A post by "mariner9" in this thread at ubuntuforums.org, confirmed by experiment.


Enable TrackPoint middle-button scrolling

To use the blue middle TrackPoint button as a scroll wheel (using the red TrackPoint itself to scroll up and down), do the following. In a terminal, enter these commands:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf-original
sudo gedit /etc/X11/xorg.conf

In the editor, find the section headed Section “InputDevice” / Identifier “Configured Mouse” and the following lines above the “EndSection” line:

Option    "EmulateWheel"        "true"
Option    "EmulateWheelButton"  "2"

Save the file. Logout, restart X with Ctrl-Alt-Backspace, and log in again.

Source for this item: Many ThinkPad-related sites, confirmed by experiment.


Improve power management features with laptop-mode-tools

Use the laptop-mode-tools package to dim the display, reduce power use, and spin down hard disks more quickly when the computer is running on battery power. Do not install the older laptop-mode package that you will find listed in Synaptic; instead, download the most recent Debian package from the project page, and follow the installation instructions.

Note: An earlier version of this page recommended noflushd, a program that spins down the hard disks when not in use, but laptop-mode-tools is more effective, and you probably should not use both.


Enable the Page-Back and Page-Forward keys in Firefox

The Page-Back and Page-Forward keys on each side of the cursor up key are not normally functional in Ubuntu. To enable these keys in Firefox, perform the following two steps. Open a terminal; make sure that the last characters in the prompt are :~$ and enter this command:

gedit .Xmodmap

Be certain to use the dot and the upper-case X. Enter these two lines into the empty file in the editor:

keycode 234 = F19
keycode 233 = F20

Save the file and close the editor.

Log out and log in again. When you log in, you will see a dialog headed "Load modmap files". Select .Xmodmap in the list of Available files, and click Load. Click OK. Open Firefox and go Rob Mayoff's page about IBM keyboard navigation keys, find the section headed "Telling the Browser What To Do" and click on the link that runs an installer. After setting the security options to allow you to install from that page, click the link again and install the software. You will see no indication that anything has changed. Close and reopen Firefox, visit two or three pages, and use the Page-Back and Page-Forward keys to move between them.

Note: You may also use the Page-Back and Page-Forward keys for any Gnome feature (such as switching between virtual desktops) by assigning F19 and F20 to any function available in System | Preferences | Keyboard Shortcuts. Doing so will disable any special use of the keys in Firefox, however.

Source for this item: Rob Mayoff's page, as listed above, and many other pages on similar topics, including this one and this one.


Change CPU frequencies easily from the Gnome panel

Breezy does an excellent job of slowing down the processor to save power, but you may want to change its setting with one or two clicks by installing the Gnome CPU Frequency Control Applet. Open a terminal and enter:

sudo chmod +s /usr/bin/cpufreq-selector

 This allows you to use the applet to control frequency, not only see what frequency is in use. Install the applet itself by right-clicking on the panel at the upper right of the screen and then select Add to Panel; in the Add to Panel window select CPU Frequency Scaling Monitor, and click Add. You can change the CPU frequency from the applet's drop-down menu.

Source for this item: This thread and others at ubuntuforums.org.


DMA problems on the Ultrabay DVD

Reports on ubuntuforums.org and elsewhere mention slow performance on the DVD drive in the ThinkPad Ultrabay. I have not tested this, but if you experience the problem, you might want to search ubuntuforums.org for answers.


A note on the ThinkPad Dock II

All ports on the ThinkPad Dock II seem to work with Ubuntu, and an optical or hard drive in the Ultrabay 2000 is recognized as part of the system. "Warm docking" is not supported by Linux; you must turn off the computer before docking or undocking.

As far as I can determine, suspend-to-RAM (sleep) does not work when the ThinkPad is docked; the system "sleeps" but will not wake again; you must power it down by holding down the power button and then restart it, and of course any work that was unsaved when you suspended the system will be lost.

A bug in Breezy prevents the operating system from automatically mounting a diskette in the "legacy" floppy drive that can be installed in the Dock II. (This problem does not apply to USB floppy drives.) To solve this problem, run the following command from a terminal:

gedit fixpmount

In the editor, paste the following lines:

#!/bin/bash

wget http://archive.ubuntu.com/ubuntu/pool/main/p/pmount/pmount_0.9.6-1_i386.deb
dpkg -i pmount_0.9.6-1_i386.deb rm pmount_0.9.6-1_i386.deb

Save the file and close the editor. Then, without leaving the terminal, enter this command:

sudo sh fixpmount

You may then, if you like, delete the fixpmount file that you created.

Source: A posting by joaoeb at ubuntuforums.org.


Networking


Don't slow boot-up by synchronizing with network time

Ubuntu pauses during boot-up while attempting to synchronize the system clock with a remote time server, but you probably aren't connected to the internet when you boot with a ThinkPad, so this attempt accomplishes nothing. . Eliminate this delay by opening a terminal and entering:

cd /etc/rcS.d
sudo mv S51ntpdate _S51ntpdate

This step is easily reversible by renaming the files again.

To make sure that your ThinkPad gets the correct time from the Internet, use the Gnome menu System | Time and Date, and add a checkmark next to "Periodically synchronize clock with internet servers." At the prompt "NTP support is not installed," click on the button that installs NTP support. Do not try to add the checkmark next to "Periodically synchronize..."; instead close the Time and Date dialog; reopen it; and now add the checkmark and click "Select Servers..." to choose some servers near you.

A note for serious experts only: A more elegant solution for disabling clock synchronization on bootup, and also for disabling network hotplug, software RAID, logical volume management, and enterprise volume management was offered by "mlomker" in a thread in the Ubuntu forums. I have not tested this procedure, but the author of it is highly reliable. If you use software RAID, LVM, or EVM, you should remove the relevant lines. And you do all this at your own risk, because I have not tested this procedure. To disable these bootup services, run the following commands in a terminal:

sudo update-rc.d -f ntpdate remove
sudo update-rc.d -f hotplug-net remove
sudo update-rc.d -f mdmadm-raid remove
sudo update-rc.d -f lvm remove
sudo update-rc.d -f evms remove

And if you later want to restore the services you removed, enter some or all of the following commands in a terminal (do not forget the dots at the end or middle of some commands):

sudo update-rc.d ntpdate start 51 S 2 .
sudo update-rc.d hotplug-net start 41 2 S . stop 89 0 6 .
sudo update-rc.d mdadm-raid start 04 S .
sudo update-rc.d mdadm-raid start 50 0 6 .
sudo update-rc.d lvm start 26 S .
sudo update-rc.d lvm start 50 0 6 .
sudo update-rc.d evms start 27 S .
sudo update-rc.d evms start 49 0 6 .


Install NetworkManager for effortless networking

Do not use the network monitor applet on the upper right Gnome menu panel; instead, right-click on it and select Remove from Panel. (You can always put it back by right-clicking on the panel and choosing Add to Panel.) After enabling additional repositories for the update manager, use Synaptic to dowload and install network-manager (notice the spelling, which includes the hyphen between the two words). You will see no visible change in your system after the program has been installed; close Synaptic. Use System | Preferences | Sessions, go to the Startup Programs tab, and use the Add button to add the following command:

nm-applet

Assign it an order of 10 or some other low number so that it runs soon after you log in. Close the dialog. Log out and log in again.

When your Gnome session begins, you will see the NetworkManager icon on the Gnome panel at the top. If you have a wired network, your network should be working perfectly. If you want to use a wireless network, click on the NetworkManager icon and select the network you want. You will be prompted to create a password for the default keyring; choose a brief, easy-to-type password, because you may be prompted to enter it often. Follow the prompts to connect to your preferred network.

With NetworkManager running, your system should automatically switch between wired and wireless networking whenever you attach or detach an ethernet cable; the changeover typically requires five seconds. In some instances, you may need to click on the NetworkManager icon to remind it to make the switch, but it normally works perfectly.

To turn off the wireless radio, right-click on the NetworkManager icon and choose Stop All Wireless Devices. The same menu lets you restart wireless devices.

Important note:  If your system takes a long time to boot because it is unsuccessfully attempting to connect to a network, you may have deliberately or inadvertently enabled automatic loading of your ethernet or wireless interface. This is easy to fix. Use an editor to modify the /etc/network/interfaces file, and comment out (by adding the # character at the start of the line) any line that begins "auto eth0" or "auto wlan00" or "auto ath0"; but do not comment out the line that reads "auto lo". Make sure that the "auto lo" line is not commented out.

Note about WPA encryption: I have not experimented with WPA encryption, but will post when I find out the easiest way to use it. Meanwhile, you may want to study the advice on J. Kraemer's site, in the section headed "Wireless LAN", or a detailed post by rossman in the forum at Thinkpads.com.


Install Bluetooth support

I don't own any Bluetooth devices, so I can't test this feature in detail, but if you use Synaptic to install gnome-bluetooth, you will add two Bluetooth-related items to your Applications | System Tools menu: Bluetooth File Sharing and Bluetooth Manager. Make sure that Bluetooth is switched on (use Fn+F5 if necessary) before using either of these.


Install a modem driver

If you travel with your ThinkPad, you will someday need the modem. Do not waste time trying to install any of the open-source drivers supposedly available for the built-in modem; you will not a get a dial tone with any of them. (But see the note below). Instead, install the commercial Linuxant driver. Test it first with a free version limited to 14.4bps connections; the full version costs US$19.

Before attempting to installing the driver, you must use the Synaptic Package Manager to install gcc-3.4 and linux-headers-686 and, perhaps, linux-headers-386.

Then, go to the Linuxant modem driver installer page and follow the instructions on the page to install the driver.

Very important: After installing the driver, your system will not be able to hibernate (suspend-to-disk) until you perform the following step. In a terminal, enter the following command:

sudo gedit /etc/default/acpi-support

In the editor, find the line that begins STOP_SERVICES, and add the string hsf within the quotation marks so that the line looks something like this:

STOP_SERVICES="mysql hsf"

Save the file and close the editor. Try to hibernate the system. If the system refuses to hibernate, enter this command in a terminal and then try again:

sudo /etc/init.d/acpid restart

Note: I have not tested this, but the unofficial Ubuntu guide at ubuntuguide.squarecows.com suggests this procedure for installing the open-source modem driver:

uname -r (must be 2.6.10-5-386)
wget -c http://frankandjacq.com/ubuntuguide/sl-modem-modules-2.6.10-5-386_2.9.9a-1ubuntu2+2.6.10-34_i386.deb
sudo dpkg -i sl-modem-modules-*.deb
sudo apt-get install sl-modem-daemon

 Again, I have not tested this; if it works, please let me know.


Using the ThinkPad buttons


Install on-screen confirmation for the ThinkPad buttons (other than Fn+F5)

The standard ThinkPad Fn-key combinations work almost perfectly out of the box, but provide no visual feedback on screen. If you want an on-screen confirmation of the effect of most of the ThinkPad buttons (except Fn+F5, discussed separately), make sure that you have enabled additional repositories, and use Synaptic to download and install the tpb (ThinkPad Buttons) program.

Next, in a terminal, enter this command (replacing yourusername with your actual username):

sudo adduser yourusername  nvram

Alternatively, you can use the System | Administration | Users and Groups applet, and go to the Groups tab where you can add individual users to the nvram group.

Now, do one (or both) of two things. Either:

(a) Use System | Preferences | Sessions, go to the Startup Programs tab, click Add, and enter:

tpb -d

and assign it the default order of 50 (or any other number you want, although higher is probably better). Click OK and close the dialog box. Now log out and then log in again, and you should see visual feedback for the ThinkPad buttons. (You may need to reboot before you see visual feedback; if so, please let me know and I will revise this page.)

or (b) If you want tpb to run automatically for all users on your system, with no further installation (except that for each user you will need to repeat the "sudo adduser" step described above), go to a terminal and enter:

sudo cp /etc/modules /etc/modules-original
sudo gedit /etc/modules

and add the following line after the last line of the file:

nvram

Save the file, close the editor, and reboot; when your Gnome session begins, you should see visual feedback for the ThinkPad buttons.

Note that you can do both (a) and (b), without causing any problems.

Optional details: You can adjust the way in which the ThinkPad Buttons program works by modifying its configuration file and rebooting your machine. For example, if you want the Access IBM button to start your screensaver, open a terminal and enter these commands:

sudo cp /etc/tpbrc /etc/tpbrc-backup
sudo gedit /etc/tpbrc

Edit the file by adding this line below the line that begins #THINKPAD /usr/bin, etc.:

THINKPAD /usr/bin/xscreensaver-command -activate

Save the file and close the editor. In the terminal, run  man tpb  to learn about other ways to use the Access IBM button.

Note for experts only: If you want to modify the action that occurs when you close the lid, edit the script /etc/acpi/events/lidbtn so that the action points to a different script, for example, action=/etc/acpi/sleep.sh


Visual feedback for Fn+F5 (Wireless on/off)

Part 1: Install and enable OSD display

To enable visual feedback for the Fn+F5 button similar to the feedback provided by the tpb program, perform the following steps, suggested by J. Kraemer.

First (if you have not already done so) enable additional repositories for the update manager, then use Synaptic to download and install xosd-bin, which makes it possible to display any text on the display with the command osd_print.

Next, create the following /etc/gdm/PostLogin/Default script by entering the following command in a terminal:

sudo gedit /etc/gdm/PostLogin/Default

and insert the following in the editor window:

#!/bin/sh
#
TMPFILE=/tmp/X_user_for_osd
echo $USERNAME > $TMPFILE
# as the file we create is used in a script which will be run as root,
# make sure nobody can mess around with it...
chmod 600 $TMPFILE

Save the file and close the editor. Make the file executable by entering in a terminal:

sudo chmod +x /etc/gdm/PostLogin/Default

This script registers your user name in a file every time you log in to Gnome.

Next, create the following /etc/acpi/osd script by entering the following command in a terminal:

sudo gedit /etc/acpi/osd

and insert the following in the editor window:

#!/bin/bash

# /etc/acpi/osd
# written by J Kraemer, output and location modified by EM
# output closely matches default output of tpb on-screen display

osd_print() {
  xuser=`cat /tmp/X_user_for_osd`
  su - $xuser -c "echo $1 | DISPLAY=:0.0 osd_cat -d 3 -p bottom -A left -O 1 -s 2 -S black -i 25 -o -21 -c blue &"
}

Notice that everything from su to the ampserand-quotation mark is on a single line. Save the file, close the editor, and make the file executable by entering in a terminal:

sudo chmod +x /etc/acpi/osd

This script sends the output to the current user's display. The -d parameter is the number of seconds the text will display; the -p parameter determines the appearance of the output. See the osd_cat man page for further details.

Part 2: Modify the existing Fn+F5 script

Now, modify the existing Fn+F5 script after first backing it up; to do so enter following commands in a terminal:

sudo cp /etc/acpi/ibm-wireless.sh /etc/acpi/ibm-wireless.sh-original
sudo gedit /etc/acpi/ibm-wireless.sh

Replace the existing script with the following:

#!/bin/bash
# Find and enable/disable wireless devices; modified by EM for use with OSD, based on work by J Kraemer
# /etc/acpi/ibm-wireless.sh

. /etc/acpi/osd

state=`. /etc/acpi/wireless.sh`

if [ "$state" = "0" ]; then
   osd_print 'Wireless off'
else
    osd_print 'Wireless on'
fi

Save the file and close the editor. In a terminal enter:

sudo /etc/init.d/acpid restart

Log out and log in again. You should see visual feedback for the Fn+F5 button in the same position on screen where the tpb program displays its feedback.

Source: Both parts of this section are based on a section in a superb page by J. Kraemer on Ubuntu on a ThinkPad T42; I have modified file locations and some of the content in order to make the OSD output match more or less exactly the output of the tpb program. I have corrected a serious error in the second script with the help of Wolfgang Roessler (correction added 14 March 2006).


Use Fn+F6 to toggle Bluetooth, with visual feedback

You may want to use the Fn+F6 button to toggle Bluetooth only, without affecting your 802.11x wireless radio. If you have not already done so, first perform all the steps listed in Part 1: Install and enable the OSD display in the section immediately above this one.

In order to let your system recognize the Fn+F6 hotkey, enter the following command in a terminal:

sudo cp /etc/modprobe.d/ibm_acpi.modprobe /etc/modprobe.d/ibm_acpi.modprobe-original
sudo gedit /etc/modprobe.d/ibm_acpi.modprobe

In the editor, change the hex number 0xff9f to 0xffff (that is, change the "9" to an "f"), save the file, and close the editor. Reboot your system.

Source for the above step: This wiki page.

Now create the two scripts required to detect the Fn+F6 hotkey and to toggle Bluetooth when the key is pressed. First create the script that detects Fn+F6. In a terminal, enter:

sudo gedit /etc/acpi/events/ibm-bluetooth

In the editor, paste these lines into the empty file:

# /etc/acpi/events/ibm-bluetooth
# This is called when the user presses the FN-F6 keys and calls
# /etc/acpi/local/ibm-bluetooth-osd.sh for further processing.

event=ibm/hotkey HKEY 00000080 00001006
action=/etc/acpi/ibm-bluetooth-osd.sh

Save the file and close the editor. Now, in a terminal, enter:

sudo gedit /etc/acpi/ibm-bluetooth-osd.sh

In the editor, paste these lines into the empty file:

#!/bin/sh
#/etc/acpi/ibm-bluetooth-osd.sh

. /etc/acpi/osd

cat /proc/acpi/ibm/bluetooth|grep status|grep -q enabled
if [ $? == 0 ]; then
  echo disabled > /proc/acpi/ibm/bluetooth;
  osd_print 'Bluetooth off'
else
  echo enabled > /proc/acpi/ibm/bluetooth;
  osd_print 'Bluetooth on'
fi

Save the file and close the editor. Make the script execuatable by entering this command in a terminal:

sudo chmod +x /etc/acpi/ibm-bluetooth.osd-sh

Next, restart acpi by entering this command in a terminal:

sudo /etc/init.d/acpid restart

Fn+F6 should now toggle Bluetooth on and off and display a message on screen.

Note for experts: You can enable similar events by creating scripts for other Fn-keys; see this table of keys and codes.


Other ThinkPad-related software


Gaim-ThinkLight

I have not tested this, but a program that blinks the ThinkLight when a message arrives for you in Gaim may be downloaded from this page and is discussed by the author on this page.