t480s

After using a mac for my primary development machine for about 10 years, I recently obtained the lenovo thinkpad t480s instead of a macbook.

Here's the basic specs...

Processor: i5-8250U

Display Type: 14.0" FHD (1920 x 1080)

Memory: 16g DDR4 (8g DDR4 + 8g DDR4)

Harddrive: 256g SSD (PCIe)

The price difference between the 500g and the 256g was about 100 dollars. I debated getting the 500g/1tb versions but opted to do that upgrade afterwards (just as I did the extra ram). For this setup, I will buy a 1tb M.2 NVMe Drive. This will end up costing about the same as the 500g version but with 750 more gigs.

First Impressions

The first noticble difference was the keyboard of course. Being very displeased with the latest keyboard that comes standard on the 2018-2019 macbooks this was a solid improvement. The keys are (subjectively) better for me. I prefer a stiffer key and the slightly raised keys on this lenovo fits the bill.

Next, I spent a good while installing an alternate operating system. The lenovo t480s I bought shipped with windows 10. I had no intention on using that OS at all on this laptop, so I had downloaded a recommended OS (debian based) PopOS (version 19).

First time around I had some issues with forgetting to turn off "secureboot" in the bios, which caused the bootloader to fail several times. I reinstalled the OS thinking it would be resolved, which caused me to lose a few hours of sleep waiting on the final OS install. Whoops... lesson learned.

Turn OFF safeboot before (or after) installing a linux OS

Development Setup

I've written about this in the past and PopOS is really similar to my previous ubuntu development setup.

Emacs is my primary IDE/Editor so no reason to switch to anything there. Checkout my updated dotfiles

Gnome tweaks is essential to a proper setup. To make my experience more like a mac some "advanced" keybinds were put in place. Here are the settings that make my experience a bit better

Ctrl position: Swap Left Alt with Left Ctrl (removed after further keybind setup)

Caps Lock Behavior: Make Caps Lock an additional Esc

Alt/Win Behavior: Ctrl is mapped to Alt; Alt is mapped to Win

gTile is good, but can get messy when you start customizing it.

Terminal is good enough (with zsh/oh-my-zsh).

Signal and Discord for chatting, works just fine in linux.

More on Keyboard Shortcuts

After a little bit of time, I realized that I really missed having the extra ctrl key mapped to Control Left which using gnome tweaks for some reason lacks this mapping posibility.

Using this program:

xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'

I am able to obtain the keycodes from buttons pressed in my terminal.

This lead me to xmodmap which allows me to map any keycode.

Creating a file ~/.xmodemap:

 ! undo any meta keys already set
 clear Mod1

 ! keycodes 63 and 71 are the left and right COMMAND buttons adjacent to the spacebar; set them to be control keys
 keycode 63 = Control_L
 keycode 71 = Control_R

 ! keycodes 66(capslock) and 
 keycode 66 = Escape NoSymbol Escape
 ! keycodes 69 is the option/alt keys; assign them as Meta key
 keycode 69 = Meta_R

 ! now tell X11 that the Meta keys act as the Mod1 (meta) modier key; that is, when they are pressed with KEY, it is the same as hitting M-KEY
 add Mod1 = Meta_L Meta_R

 ! tell X11 that the Control keys are Control modifiers, so when pressed with u (for example) it is the same as hitting C-u
 add Control = Control_L Control_R

 ! control to control; reset due to gnome tweaks...
 keycode 37 = Control_L

Run xmodmap ~/.xmodmap

Now, Ctrl is Ctrl, Windows key is Meta, and Alt is also Ctrl. Giving me a "command" button type feel, while also giving a OSX like Emacs C- key.

Note: It appears the xmodmap needs to apply every time we startup gnome. To run this on startup, I created a little startup program xmodmap.sh:

#!/bin/bash
sleep 1;
echo "running xmodmap" 
xmodmap ~/.xmodmap 

Then added this to my gnome startup scripts.