New laptop, all around great linux workstation

1 The way I buy stuff when I was just fine with what I have before it broke

The Macbook Pro 11,1 (retina) I have been using with Linux for years as my main personal and work machine, recently developed multiple hardware issues:

  1. the USB3 internal hub was dying now and then, thrice a week
  2. the battery was down to 70% of its original capacity, 3 to 4 hours.
  3. the screen coating was starting to go green and peeling off AGAIN

It was a great everyday laptop that I met my needs perfectly:

  1. A great feature set: great connectivity, great screen, thin and compact, not too heavy but stable enough … Kind of a unique package.
  2. The keyboard was OK, I appreciated that the keys were relocatable to a dvorak layout.
  3. Fast and powerful enough with an (now old) i7 CPU, 16GB of RAM, 512GB SSD …

I have been using thinkpads 15 years ago and I still own 2 X220, but they weren't as good as this rmbp, so I setup one for my dad and the other as a live spare (syncthing and git make it very straightforward).

I waited a few months before deciding to replace the rMBP, trying to fix the USB3 / XHCI issue to no avail. Every now and then, the laptop USB hub would just come out of suspend and die, forcing me to ssh in and reboot. This problem seems part aging - part linux support. Anyway, the day it failed twice in a day was dies irae and I decided to replace it. However, buying is something I don't like too much:

  • I have this feeling that you can never truly get everything as good as the thing you are replacing.
  • I don't have a collector mindset. Everything I own has a weight attached to it, only relieved by its usefulness.
  • I usually buy stuff "used" because I usually don't need "new", more power, storage, … and I don't like the "new" shops, I prefer the "second hand" ones :)
  • I like to be able to act on the things I buy, may it be replace the car fluids, change the plane blades or replace the laptop internal battery.

So I started a week long research … actually no, I just ragequit work early, looked at the offers from the refurb shops on my way home, jumped out the tram, picked a lenovo t470 for 350€ that looked OK and arrived home. 30 minutes. You can't go wrong with a lenovo T/X series.

1.1 And that's it?

Well not exactly.

I also bought, new, from amazon a battery set, a new keyboard and some RAM. Buying "used" laptops is just like buying "used" cars, you may need to change some wearable components.

  current upgradeable to …
CPU 2.4GHz 6th gen i5 I don't plan to, but it's possible
RAM 8GB up to 64, I plan on 16
storage 1x256GB nvme SSD SSD or nvme AND another nvme
power 6 cell batteries two batteries! 9 and 4 cells !
keyboard azerty qwerty
display fullhd IPS QHD mod ? Not for me.

2 Why this laptop is better than expected?

I was pretty pissed when I bought this laptop and didn't have much expectations other than "just work good enough so I don't have to suffer this rMBP anymore".

2.1 two batteries! Lots of autonomy!

This laptop can host two batteries and has great power management.

I bought a new 61++ 9 cells external battery and an internal battery (4 cells), for 100€ on Amazon :

% sudo tlp-stat -b
--- TLP 1.1 --------------------------------------------

+++ ThinkPad Battery Features
tp-smapi   = inactive (kernel module 'tp_smapi' not installed)
tpacpi-bat = active

+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer                   = SANYO 11-
/sys/class/power_supply/BAT0/model_name                     = 01AV419
/sys/class/power_supply/BAT0/cycle_count                    =      1
/sys/class/power_supply/BAT0/energy_full_design             =  24350 [mWh]
/sys/class/power_supply/BAT0/energy_full                    =  25410 [mWh]
/sys/class/power_supply/BAT0/energy_now                     =   4820 [mWh]
/sys/class/power_supply/BAT0/power_now                      =   4333 [mW]
/sys/class/power_supply/BAT0/status                         = Discharging

tpacpi-bat.BAT0.startThreshold                              =     96 [%]
tpacpi-bat.BAT0.stopThreshold                               =    100 [%]
tpacpi-bat.BAT0.forceDischarge                              =      0

Charge                                                      =   19.0 [%]
Capacity                                                    =  104.4 [%]

+++ ThinkPad Battery Status: BAT1 (Ultrabay / Slice / Replaceable)
/sys/class/power_supply/BAT1/manufacturer                   = SANYO
/sys/class/power_supply/BAT1/model_name                     = 01AV423
/sys/class/power_supply/BAT1/cycle_count                    =      1
/sys/class/power_supply/BAT1/energy_full_design             =  71280 [mWh]
/sys/class/power_supply/BAT1/energy_full                    =  71220 [mWh]
/sys/class/power_supply/BAT1/energy_now                     =  71210 [mWh]
/sys/class/power_supply/BAT1/power_now                      =      0 [mW]
/sys/class/power_supply/BAT1/status                         = Unknown (threshold effective)

tpacpi-bat.BAT1.startThreshold                              =     96 [%]
tpacpi-bat.BAT1.stopThreshold                               =    100 [%]
tpacpi-bat.BAT1.forceDischarge                              =      0

Charge                                                      =  100.0 [%]
Capacity                                                    =   99.9 [%]

+++ Charge total                                            =   78.7 [%]

Now, I am typing this on a plane between Paris (France) and Bengaluru (India), and after 4 hours of usage (music playing and text editing mostly, at minimal settings):

The battery reports a discharge rate of 4.42 W
The estimated remaining time is 17 hours, 17 minutes

It was around 21 hours when both were full. This is truly amazing.

Moreover, you can hotswap external batteries since the integrated one is always in. Stupid thing though: the internal battery is the first to discharge!@# And eventually, it stops when the internal battery goes dry.

2.2 The keyboard

Thinkpad keyboards are great. I like the old thinkpad keyboards (X220-) more than the new one (X230+), but they are still better than my previous rMBP which themselves are much better than the new macs clicky and buggy flat keyboard.

Anyhow, this is a pleasure.

My mac had this relocatable keys feature than I really enjoyed though as I use dvorak. Dvorak is a reshuffle of a qwerty keymap (the non-letter keys remains the same : [!1]...[)0]). So, pop out and in the keycaps of a qwerty mac, and benefit from a dvorak mac!

Thinkpads are unfortunately not build this way, since they feature the MIGHTY TRACKPOINT so you either stick stickers on the keycaps or type blind. I set right control key to switch between layouts, so if I need to, I can still borrow my laptop.

% cat /etc/default/keyboard 

2.2.1 DONE Fix the Hyper key for emacs / org mode

Emacs uses the hyper key in org mode for some convenient actions and well, there is no such thing as an hyper key on a keyboard so I dedicate the left control to be hyper in emacs, capslock being remap to control. This is a bitn messy.

2.3 Firmware upgradability, from linux, thanks to fwupd

fwupd fetches updates published by lenovo to the fwupd repositories (some kind of consortium). I hope to fix this battery discharge sequence soon.

% sudo fwupdmgr get-devices

T470 Thunderbolt Controller
  DeviceId:             06bdff4dc08ff9ed90c3aa1efc7e7557df1c80e2
  Guid:                 6c2c78b7-81fa-566e-b0ff-e727dbb297a5 <- TBT-01091601
  Summary:              Unmatched performance for high-speed I/O
  Plugin:               thunderbolt
  Flags:                internal|updatable|registered
  Vendor:               LENOVO
  VendorId:             TBT:0x0109
  Version:              04.00
  Icon:                 computer
  Created:              2020-02-26

20JNS3FG00 System Firmware
  DeviceId:             888f97106c5be770592b21740d18c1d29aa8e1b9
  Guid:                 4e06f4ae-ab2e-4804-9a23-888e596a31e7
  Plugin:               uefi
  Flags:                internal|updatable|require-ac|supported|registered|needs-reboot
  Checksum:             SHA1(d4e8e4354358de9bb80c0a65d4d7bc902f7aec15)
  Version:              0.1.61
  VersionLowest:        0.1.23
  Icon:                 computer
  Created:              2020-02-26

UEFI Device Firmware
  DeviceId:             4718f2fc055b1c4de66633017326683a72592b4c
  Guid:                 bcff5fd8-0a99-48ad-b630-40e8eadb190e
  Plugin:               uefi
  Flags:                internal|updatable|require-ac|supported|registered|needs-reboot
  Version:              184.50.3425
  VersionLowest:        0.0.1
  Icon:                 audio-card
  Created:              2020-02-26
  UpdateState:          success

UEFI Device Firmware
  DeviceId:             efc88c8524a5d0ada629ba38b89ac722dc3d5efb
  Guid:                 4b37c365-ecb2-4d89-8e15-e93c27c6ce12
  Plugin:               uefi
  Flags:                internal|updatable|require-ac|supported|registered|needs-reboot
  Version:              0.1.35
  VersionLowest:        0.0.1
  Icon:                 audio-card
  Created:              2020-02-26

  DeviceId:             c82980cd3fe66f7d0a8bb83b353cbc271177efd4
  Guid:                 5b3df2da-f745-5fd0-81de-5dafd7f0bf8c <- NVME\VEN_144D&DEV_A804
  Guid:                 8fd4ca73-d0ae-52e8-8977-461435c6f4cf <- NVME\VEN_144D
  Guid:                 257d6faa-82f3-53e2-afa4-f6b9adc9595d <- SAMSUNG MZVLW256HEHP-000L7
  Serial:               S35ENA0K247410
  Summary:              NVM Express Solid State Drive
  Plugin:               nvme
  Flags:                internal|updatable|require-ac|registered|needs-reboot
  Vendor:               Samsung Electronics Co Ltd
  VendorId:             NVME:0x144D
  Version:              4L7QCXB7
  Icon:                 drive-harddisk
  Created:              2020-02-26

2.3.1 DONE Fix the fact that it doesn't actually work

Yeah, well, please take care to install in EFI mode. For some reason, the BIOS on mine was set to legocy boot mode only … Better reset this BIOS anyway.

2.4 i3 and gnome together

I have been using "lightweight" environment for two decades now, mostly a window manager, terminals and a web browser. And quite a lot of other programs around to handle media keys, screensaver, session locking, app launching, energy saving, wifi management…

OpenBSD provides a great out-of-the-box experience on thinkpads, where energy saving, medias keys and more are just provided as base features, no setup required –and I am not actually sure– possible.

The result is just GREAT:

  • the media keys just works as expected, even micmute and such (I can drop my custom hotkeys tool)
  • the system locks the screen with a password (so I can drop slock and xidle)
  • the keychain and agents work, to mount encrypted drives or connect to ssh servers
  • the external monitors setups is remembered (so I can drop my autorandr scripts)
  • the Settings app is fine
  • everything is as snappy as before