ThinkPad W540 and Ubuntu

I recently got a new laptop to replace my old ThinkPad W520, I wound up just getting the current version of the same line. Unfortunately because of UEFI and SecureBoot the installation was a bit of an adventure, but I got it working surprisingly easily. Essentially I wound up turning off everything related to the new UEFI and SecureBoot verification things along with FastBoot, and dualbooting Ubuntu with Windows 7. The copy of Windows 8 that came with the laptop didn't work with Legacy Boot, and I couldn't get a bootloader (either the EFI one or grub) to notice Ubuntu when in the not-Legacy Boot mode.

On a fresh install of Ubuntu, most of the hardware works pretty nicely. There's a few things that are a little annoying, and I'm looking to fix. Some is on a hardware/firmware level so I can't do much about it, but a lot is fixable in software.

The W540 has a new "FnLk" function, which means the F1...F12 keys are co-opted by Lenovo's multimedia and hardware controls (volume, screen brightness, wireless toggle, a few other basics, and a couple symbols I don't recognize). If you turn FnLk on, single presses of the F1...F12 keys work normally, and holding down Fn while hitting the-m gives you the secondary keys. Back to normal. Unfortunately, while FnLk is enabled, there's an LED that stays on in the Fn key. I'd like to inverse the behavior of that LED, so it stays on when the F1...F12 keys are replaced by the secondary keys. I'm not sure if this is possible in software, but I'm going to be investigating it.

Some of the keyboard keys work out of the box, like the audio mute one (it sends the keysym XF86AudioMute). There are a few extra buttons above the numpad for a calculator, some sort of lock, a web browser, and a file browser. It looks like the keys that don't work are turning up as a different input device labeled as /dev/input/by-id/platform-thinkpad_acpi-event (a link to /dev/input/event5 on my system, at the moment). I figured it out by using my keycast daemon up here: https://github.com/AlexWillisson/keycast and having it read from /dev/input/event* Just don't leave keycast running, it's essentially a keylogger that broadcasts keystrokes over TCP to anyone who asks instead of storing the keystrokes. Good for debugging and running on a raspberry pi using a USB HID (such as a keyboard or Makey Makey), terrible for security.

Once I'm done getting my keyboard to work, the code for handling the keys on platform-thinkpad_acpi-events will be up at https://github.com/AlexWillisson/tp-w540-keys I may post more information about setting things up.

Other issues with the system include:

  • Graphics switching
  • Too many pixels (I have the 2880x1600 screen and don't want to set up 2x DPI scaling since I like having at least 1920x1080, so my text is tiny)
  • Suspend
  • Hibernate
  • LED on microphone mute key
  • Fingerprint reader
  • Smartcard reader

For the record, I'm running Ubuntu 14.10 on this system with Fluxbox as my window manager. xscreensaver for my screen saver, and compton for my compositor (allows window transparency and other neat tricks like that).