Installing Ubuntu 12.04 (Precise Pangolin) on a ThinkPad X220

From ThinkWiki
Revision as of 16:14, 14 September 2013 by Jdthood (Talk | contribs)
Jump to: navigation, search

I installed Ubuntu 12.04 LTS (Natty Narwhal) on a ThinkPad X220, model 42902GW.

Update: In October 2012 I upgraded to 12.10. Update: In May 2013 I upgraded to 13.04. This resulted in hangs on reboot. These were eliminated when I installed the latest kernel from the raring-proposed repo. See also Updates below.

This is the same machine on which I previously installed Ubuntu 11.04. For this LTS release I decided to do a clean install rather than an upgrade from 11.10.

With every release of Ubuntu, more and more aspects of the system work correctly without any manual intervention. Here is a summary of what I nevertheless had to do to get the machine back to the way I like it.

  • Associate my bluetooth HIDs
  • Adjust display layout
    • Problem: With some layouts the machine hangs! Will look into this.
  • Adjust touchpad
    • Switch to two-finger scrolling
    • Disable mouse clicks
  • Install compizconfig-settings-manager and run ccsm:
    • Assign the Resize Windows function to Alt-Button3 which is easier than the default, Alt-Button2. Update: The upgrade to Ubuntu 12.10 reverted this setting to the default, so I had to set it again.
  • Enable terminal bell:
    • Run gconf-editor and use it to change desktop | gnome | peripherals | keyboard | bell_mode from "off" to "on"
    • Add "pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg" to ~/.xprofile
    • Add "[ "$DISPLAY" ] && xset b 100" to ~/.bashrc
  • Install tp-smapi module
    • Install the tp-smapi-dkms package
    • Add "tp-smapi" to /etc/modules
  • Install HDAPS stuff:
    • Add "hdaps" to /etc/modules
sudo add-apt-repository ppa:linrunner/thinkpad-extras
sudo apt-get update
sudo apt-get install hdaps-utils
sudo modprobe hdaps
hdaps-gl
  • In /etc/sudoers.d/local add "Defaults timestamp_timeout=0"

(Without this, every program I run after executing any command with sudo also effectively has full root privileges. This is ungood. If I want to run a sequence of commands as root without having to authenticate every time I'll just do "sudo su" to start a root shell!)

  • Enable fingerprint reader as I described here.

For Ubuntus prior to 12.10 add the "fingerprint" PPA as follows.

sudo add-apt-repository ppa:fingerprint/fprint

For all Ubuntus...

sudo apt-get install libpam-fprintd fprintd
fprintd-enroll
sudo vi /etc/pam.d/lightdm
  • Set up hotkeys (zoom and micmute) as I describe below
  • Disable Unity automaximization
    • Install and run gconf-editor and set apps|compiz-1|plugins|grid|screen0|options|top_edge_action to 0 (originally 10).
  • Move documents, pictures and other personal files from old to new home directory
  • Set desktop background image
  • Change format of the date and time displayed on the menu bar to "Tue 15 May 2012 14:09:11"
gsettings set com.canonical.indicator.datetime time-format "'custom'"
gsettings set com.canonical.indicator.datetime custom-time-format "'%a %d %b %Y  %H:%M:%S'"
  • Set up Empathy accounts, etc.

Fix for hotkey shortcomings

Earlier workaround: Installing Ubuntu 11.04 (Natty Narwhal) on a ThinkPad X220#Fix for hotkey shortcomings

By default the "zoom" (Fn-Space) and "microphone-mute" (button next to the ThinkVantage button) hotkeys do nothing.

Zoom: The thinkpad-acpi module, kernel and udev map the zoom key's ACPI event (ibm/hotkey HKEY 00000080 00001014) to input event KEY_ZOOM whose numerical value, 372, is greater than 255, the highest key-event code that X can handle.

Micmute: The thinkpad-acpi module and kernel generate an ACPI event (ibm/hotkey HKEY 00000080 0000101b) for the microphone mute button but in releases earlier than precise this is not mapped to anything; in precise it is mapped to 256 which is also greater than 255, the highest that X can handle. Bug reported here.

The fault lies with X which can't handle key codes above 255. But as discussed, e.g., here, it may be a long time before this gets fixed in X.

In Precise updates as of October 2013 a workaround has been implemented for micmute: this key is now treated as if it were F20. This will supposedly be fixed for Ubuntu 13.10 (Saucy) too.