Thinkpad X240 Arch Linux
It's 4 years since I got and setup my Thinkpad x240 using Xubuntu. I wasn't really happy with the Ubuntu subsystem anymore so I decided to set up a new OS. I went with Arch Linux this time. Still using XFCE as a Desktop Environment.
Many of the things I had to manually adjust for the hardware a few years ago now work out of the box. Below is a list of things I did.
Packages
After the basic install I installed a whole bunch of packages and configured them
- still during the installation:
vim intel-ucode grub
- Utilities:
git unzip bzip2 wget curl sudo fakeroot htop iotop make gcc openssh tree keychain imagemagick
- XFCE Desktop:
xorg xf86-video-intel mesa xfce4 xfce4-goodies lightdm lightdm-gtk-greeter light-locker mugshot gnome-keyring
- Fonts:
ttf-dejavu ttf-liberation ttf-droid ttf-ubuntu-font-family ttf-roboto noto-fonts ttf-bitstream-vera
- Sound:
pulseaudio pulseaudio-alsa alsa-utils pavucontrol
- Network:
networkmanager network-manager-applet nm-connection-editor networkmanager-openvpn openvpn gigolo gvfs gvfs-smb bind-tools
- Devel:
php-apache php-gd php-intl php-sqlite xdebug nodejs yarn docker
- Desktop-Apps:
chrome dropbox inkscape gimp geeqie hexchat
Emoji Picker
Install the ibus
and noto-fonts-emoji
and configure “Settings” → “Keyboard” → “Application Shortcuts”. Add
ibus emoji
as a shortcut (I'm using Meta
+E
). 🦊
Key Remapping
Remapping the PGUP
/PGDN
keys to POS1
/END
(and vice versa) is still something I highly recommend. Instead of doing it for X only, there is an easy way to do it on the Kernel level.
Right after installing Arch Linux, you will notice that the END
key is not working properly in the linux console.
Pressing Ctrl-V
, END
will result in ^[[2~
, though it should result in ^[[4~
. The Wiki recommends adjusting /etc/inputrc
, but since we want to remap keys anyway it is easier to simply remap the key to the proper keycode.
Mapping key presses to actual keys happens in the kernel. Each key creates a unique scan code that is then mapped to a key based on your keymap.
Using showkey –scancodes
will show you the scan codes generated by the keys in question. Calling showkey
will show you the keycodes the keys are mapped to. The problem is that the END
is mapped to keycode 110 instead of 107 (the END
key on my desktop system) - this is why the END
key behaves weird in the console.
Keycode | Scancode | remap to | |
---|---|---|---|
PGUP | 104 | e049 | 102 |
PGDN | 109 | e051 | 107 |
POS1 | 102 | e047 | 104 |
END | 110 (107) | e052 | 109 |
Keys can easily be remapped using the setkeycode
tool. To do so on boot, we need some startup script. In the olden days, we had /etc/rc.local
for that. Today we need some help from systemd. Luckily there's a systemd service that can give us our rc.local
back. It's available from AUR so I installed it with yay:
$> yay -S rc-local
Simply create a your startup file:
#!/bin/sh -e setkeycodes e049 102 e051 107 e047 104 e052 109 exit 0;
Then make it executable and setup the systemd service.
#> chmod 755 /etc/rc.local #> systemctl enable rc-local #> systemctl start rc-local
Touchpad
Modern Xorg uses libinput
instead of the old synaptics driver. It works nearly perfect out of the box. However you probably want touchtap clicking and may want to reconfigure two-finger taps as middle click instead of right click.
It's quite easy with a single additional config file:
Section "InputClass" Identifier "touchpad" Driver "libinput" MatchIsTouchpad "on" Option "Tapping" "on" Option "TappingButtonMap" "lmr" EndSection
That's it. Everything else is just working fine out of the box.