Difference between revisions of "Installing Ubuntu 12.04 (Precise Pangolin) on a ThinkPad X220"

From ThinkWiki
Jump to: navigation, search
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
 
[[User:Jdthood|I]] installed Ubuntu 12.04 LTS (Natty Narwhal) on a ThinkPad {{X220}}, model 42902GW.
 
[[User:Jdthood|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 [[Installing Ubuntu 11.04 (Natty Narwhal) on a ThinkPad X220|previously]] installed Ubuntu 11.04.
 
This is the same machine on which I [[Installing Ubuntu 11.04 (Natty Narwhal) on a ThinkPad X220|previously]] installed Ubuntu 11.04.
 
For this LTS release I decided to do a clean install rather than an upgrade from 11.10.
 
For this LTS release I decided to do a clean install rather than an upgrade from 11.10.
  
With every release of Ubuntu configuration becomes easier. Here is a summary of what I had to do to get the machine back to the way I like it.
+
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
  
* Move documents, pictures and other personal files from old to new home directory
 
 
* Adjust display layout
 
* Adjust display layout
 
** Problem: With some layouts the machine hangs!  Will look into this.
 
** Problem: With some layouts the machine hangs!  Will look into this.
* Disable Unity automaximization
+
 
** Install and run <tt>gconf-editor</tt> and set <tt>apps|compiz-1|plugins|grid|screen0|options|top_edge_action</tt> to 0 (originally 10).
 
 
* Adjust touchpad
 
* Adjust touchpad
 
** Switch to two-finger scrolling
 
** Switch to two-finger scrolling
 
** Disable mouse clicks
 
** Disable mouse clicks
* Set desktop background image
+
 
 
* Install compizconfig-settings-manager and run ccsm:
 
* Install compizconfig-settings-manager and run ccsm:
** Assign the Resize Windows function to Alt-Button3 which is easier than the default
+
** 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:
 
* Enable terminal bell:
** Run <tt>gconf-editor</tt> and use it to change desktop | gnome | peripherals | keyboard | bell_mode from "<tt>off</tt>" to "<tt>on</tt>"
+
** Run <tt>gconf-editor</tt> and use it to change desktop | gnome | peripherals | keyboard | bell_mode from "<tt>off</tt>" to "<tt>on</tt>". Update: This is not necessary or possible in Ubuntu 13.10.
** Add "pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg" to .xprofile
+
** Add "<tt>pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg</tt>" to <tt>~/.xprofile</tt>
** Add "<tt>[ "$DISPLAY" ] && xset b 100</tt>" to <tt>~/.bashrc</tt>
+
** To maximize bell volume, add "<tt>[ "$DISPLAY" ] && xset b 100</tt>" to <tt>~/.bashrc</tt>
 +
 
 
* Install tp-smapi module
 
* Install tp-smapi module
 
** Install the <tt>tp-smapi-dkms</tt> package
 
** Install the <tt>tp-smapi-dkms</tt> package
 
** Add "<tt>tp-smapi</tt>" to <tt>/etc/modules</tt>
 
** Add "<tt>tp-smapi</tt>" to <tt>/etc/modules</tt>
 +
 
* Install HDAPS stuff:
 
* Install HDAPS stuff:
 
** Add "<tt>hdaps</tt>" to <tt>/etc/modules</tt>
 
** Add "<tt>hdaps</tt>" to <tt>/etc/modules</tt>
Line 33: Line 40:
 
hdaps-gl
 
hdaps-gl
 
</pre>
 
</pre>
* In /etc/sudoers add "<tt>Defaults timestamp_timeout=0</tt>"
+
 
  Without this, every program you run after executing any command with <tt>sudo</tt> also 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 "<tt>sudo su</tt>" to start a root shell!
+
* In /etc/sudoers.d/local add "<tt>Defaults timestamp_timeout=0</tt>"
* Enable fingerprint reader as I described [[How to enable integrated fingerprint reader with fprint|here]]:
+
(Without this, every program I run after executing any command with <tt>sudo</tt> 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 "<tt>sudo su</tt>" to start a root shell!)
 +
 
 +
* Enable fingerprint reader as I described [[How to enable integrated fingerprint reader with fprint|here]].
 +
 
 +
For Ubuntus prior to 12.10 add the "fingerprint" PPA as follows.
 
<pre>
 
<pre>
 
sudo add-apt-repository ppa:fingerprint/fprint
 
sudo add-apt-repository ppa:fingerprint/fprint
 +
</pre>
 +
 +
For all Ubuntus...
 +
<pre>
 
sudo apt-get install libpam-fprintd fprintd
 
sudo apt-get install libpam-fprintd fprintd
 
fprintd-enroll
 
fprintd-enroll
 
sudo vi /etc/pam.d/lightdm
 
sudo vi /etc/pam.d/lightdm
 
</pre>
 
</pre>
* Associate my bluetooth HIDs.
 
* Set up hotkeys (zoom and micmute) as [[Installing Ubuntu 11.04 (Natty Narwhal) on a ThinkPad X220#Fix for hotkey shortcomings|I described earlier]]
 
  
[[Category: Ubuntu 12.04]]
+
* Set up hotkeys (zoom and micmute) as I describe below
 +
 
 +
* Disable Unity automaximization
 +
** Install and run <tt>gconf-editor</tt> and set <tt>apps|compiz-1|plugins|grid|screen0|options|top_edge_action</tt> to 0 (originally 10).
 +
** Install and run <tt>ccsm</tt> (compizconfig settings manager) and select the Grid plugin. On the Edges tab, disable each action by changing the value to "None".
 +
 
 +
* 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 include full date and time with seconds: "<b>2014 Mar 07 Fri 13:45:03</b>" [[File:Jdthood-custom-datetime-indicator-format.png]]
 +
<pre>
 +
gsettings set com.canonical.indicator.datetime custom-time-format "'%Y %b %d %a %H:%M:%S'"
 +
gsettings set com.canonical.indicator.datetime time-format "'custom'"
 +
</pre>
 +
 
 +
* Set up Empathy accounts, etc.
 +
 
 +
=== Fix for [https://bugs.freedesktop.org/show_bug.cgi?id=11227 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 <tt>thinkpad-acpi</tt> module, kernel and <tt>udev</tt> map the zoom key's ACPI event (<tt>ibm/hotkey HKEY 00000080 00001014</tt>) to input event <tt>KEY_ZOOM</tt> whose numerical value, 372, is greater than 255, the highest key-event code that X can handle.
 +
 
 +
'''Micmute''': The <tt>thinkpad-acpi</tt> module and kernel generate an ACPI event (<tt>ibm/hotkey HKEY 00000080 0000101b</tt>) 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 [https://bugs.launchpad.net/ubuntu/+source/udev/+bug/408903 here].
 +
 
 +
The fault lies with X which can't handle key codes above 255.  But as discussed, e.g., [https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/313514 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 [https://bugs.launchpad.net/ubuntu/+source/udev/+bug/408903 supposedly] be fixed for Ubuntu 13.10 (Saucy) too.
 +
 
 +
When I get this working I will update this page.
 +
 
 +
[[Category: Ubuntu 12.04]] [[Category: Ubuntu 12.10]] [[Category: Ubuntu 13.04]]

Latest revision as of 19:05, 16 April 2014

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". Update: This is not necessary or possible in Ubuntu 13.10.
    • Add "pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg" to ~/.xprofile
    • To maximize bell volume, 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).
    • Install and run ccsm (compizconfig settings manager) and select the Grid plugin. On the Edges tab, disable each action by changing the value to "None".
  • 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 include full date and time with seconds: "2014 Mar 07 Fri 13:45:03" Jdthood-custom-datetime-indicator-format.png
gsettings set com.canonical.indicator.datetime custom-time-format "'%Y %b %d %a %H:%M:%S'"
gsettings set com.canonical.indicator.datetime time-format "'custom'"
  • 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.

When I get this working I will update this page.