jump to navigation

Configuring Arch Linux on a Thinkpad T420 August 21, 2012

Posted by Rich in laptop, linux.
Tags: , ,

Configuring Arch Linux on a Thinkpad T420

This is a follow-on post to last time where I did a basic install of Arch linux on my Thinkpad T420.

The default Arch installation is very bare-bones, so there are several steps to getting it configured properly, such as adding a user, installing X11, and so on. Here are the T420-specific steps and notes I took to get it configured properly:


  • Install intel-ucode for latest CPU microcode, add to MODULES in /etc/rc.conf
  • While KMS is already enabled, we can enable it earlier in the boot process by adding i915 to MODULES in /etc/mkinitcpio.conf and re-generating the initcpio file
  • Increase the GRUB boot screen resolution by changing GRUB_GFXMODE in /etc/default/grub to 1024x768x32, then grub-mkconfig -o /boot/grub/grub.conf
  • Add repo-ck, install linux-ck-corex kernel, enable BFQ I/O scheduler by adding it to /etc/default/grub, and regenerate /boot/grub/grub.cfg to add the new kernel
  • Install ssmtp and forward system mail to my gmail account. Add the normal user to the mail group.


  • For alsa: install alsa-utils and use alsamixer to unmute and speaker-test to test sound, add alsa to DAEMONS in /etc/rc.conf
  • Disable PC speaker beep (didn’t happen until I unmuted ALSA) by blacklisting the pcspkr module
  • Bluetooth: install bluez, blueman. I finally got my pair of bluetooth headphones working by adding Enable=Socket and Enable=Source to /etc/bluetooth/audio.conf

GUI stuff

  • After installing Xorg, install the Xorg Intel driver: xf86-video-intel, and enable SNA, I also installed lib32-intel-dri for accelerating 32-bit applications. I found later that if I enable the "TearFree" option then xrandr doesn’t work for multiple displays properly except for mirroring.
  • Installed mplayer-vaapi, gstreamer-vaapi, and libva-driver-intel. Now running mplayer file.avi -vo vaapi gives hardware-accelerated decoding.
  • There’s a Thinkpad OSD available as tpb, but it’s really old and xfce (the DE I use) has a built-in OSD for brightness changes. So I won’t bother with it, but it’d be nice to have an OSD for volume changes someday.

Power management

  • Suspend-to-RAM (S3 sleep) works out of the box. I can even have mpd playing and suspend/resume is fine.
  • Hibernate (S5 sleep) does not work out-of-the-box, but it does after I add resume to /etc/mkinitcpio.conf between lvm2 and filesystems
  • Installed gnome-power-manager for the handy tool gnome-power-statistics
  • One feature that I like about Windows 7 is that after your laptop has been in sleep for some time, it wakes up and goes into hibernation. I found a script that does a similar thing using rtcwake.
  • I don’t think it takes a lot of power, but it’d be nice to disable the Ultrabay DVD drive on battery, since I rarely use it (especially on battery). laptop-mode-tools doesn’t seem to support this, but I found in /sys/devices/platform/dock.1 some good stuff. docked is normally set to 1, indicating that it’s docked. If I write 1 to undock then docked changes to 0. If I hit the eject button then it takes a couple of seconds longer to eject. So I think this shuts power off to the drive, and power is re-connected by hitting the eject button. This matches behavior under Windows 7. For now, I’m not going to bother with automatically shutting down the drive every time I’m on battery, but I could do this in the future.
  • Installed tp_smapi, pm-utils, acpi, powertop, acpid
  • The start_charge_thresh parameter for tm_smapi isn’t supported on the T420, but the AUR package tcacpi-bat fixes this. There are instructions here. Note that I need to specify battery 1, I can’t do battery 0 (both). As directed in the link, I add the lines to /etc/rc.local to set the thresholds upon boot-up, although it’s only needed whenever I remove/reinsert the battery.
  • Installed cpupower, and I don’t need to worry about any configuration stuff since the ondemand governor is automatically loaded for linux > 3.4
  • Installed laptop-mode-tools, sdparm
  • In configuring laptop-mode-tools, I changed lcd-brightness.conf so laptop-mode controls it and changed BRIGHTNESS_OUTPUT to /sys/class/backlight/acpi_video0/brightness, and set battery/AC values to 8/15 (out of 15 maximum levels).


  • Installed synaptics as detailed here. One hiccup is that I like both edge scrolling AND two-finger scrolling, and the xfce settings only let you choose one or the other. Furthermore, if you enable both in /etc/X11/xorg.conf.d/10-synaptics.conf, that works fine until XFCE loads and overwrites your setting. So I added an XCE autostart script to call synclient VertEdgeScroll=1; synclient HorizEdgeScroll=1.
  • The power button is not detected with xfce4. It’s not a big deal.
  • I like to disable the touchpad (mainly the buttons, since it’s on the edge of the laptop and I accidentally click these if I’m resting the laptop on my stomach), so I follow these to enable the toggle button. Instead of using xbindkeys, I used the xfce4 keyboard handler to call a one-liner script in my home directory to toggle the touchpad. I call it by using Fn+F8, the trackpad enable/disable button.

Thinkpad-specific features

  • Installed hdapsd, hdaps-gl, xfce4-hdaps, set hdaps sensitivity to 35
  • Installed thinkfan and added a configuration similar to this one. I tweaked the thresholds a bit. Also, as indicated here, the thinkpad_acpi module needs an option to enable control of the fan speeds.
  • I added some kernel parameters here. I apparently don’t need the pcie_aspm=force argument since I’m running a kernel newer than 3.3. I haven’t compared power usage with and without these arguments, so I’m just keeping them for now.


I’d like to try switching to systemd in the near future, but these notes have gotten me up and running quite well.



1. CNT` - September 13, 2012

Install the package from AUR xfce4-volumed to get OSD notifications of volume change/mute

2. badineu - December 13, 2015

Reading this in 2015. Thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: