Back to Linux after almost 3 year hiatus.
Switching back from MacBook to Thinkapad and Ubuntu as the main work machine.
My MBP 13’’ aged quite nicely, but compiling large scala codebases and running VMs / containers became quite frustrating. I was eligible for a refresher at Elastic and I’ve decided to try Thinkpad P51 + Ubuntu. This is a 15’’ beast with 64 GB of RAM. It is quite heavy, but working remotely I don’t need to carry it to the office every day, while still being able to travel if needed. I consider the trade off acceptable.
This post is a short note and what works and a note on setting it up if I need to do it again.
The out of the box experience is surprisingly good. P51 is about 1 year old, so 18.04 kernel (4.15) contains everything it needs. Basically, after the installation I’ve needed only to install nvidia drivers and change display scaling (4k screen). Second display (also 4k) works, sleep works, etc.
Different scaling on different displays. The laptop is 4k and the external
monitor I use it with is also 4k. But one of them is 15’’ and the other
27’’, so they have different DPI. Xorg doesn’t support such a config, but
there is a possible workaroudn with xrandr (keyword:
hidpi arch wiki).
I have some apple hardware, which I quite like and wouldn’t mind using with ubuntu. Esp. the airpods and the magic mouse. Airpods connect and you can use them as headphones, but the mic is off. Ubuntu doesn’t consider them a sound input, only output. You can switch the profile from hi-fidelity playback to headset, but there seems to be a bug in pulse audio and switching the profile doesn’t help (I can’t find the link right now). Workaround is to use a wired headset, but boy that sucks.
Magic mouse 2 connects, and gives you the impression that it works, but there are traps. First, it disconnects every now and then; sadly the linux–bluetooth experience is far from being “polished”. Also, the scroll doesn’t work (but a fix is being worked on, see https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver).
Firefox has laggy scrolling. The scrolling is basically broken, scroll a couple of
lines and then it becomes laggy or jerkey. I’m not sure what to
attribute it to, but it is super frustrating. As a workaround I’ve switched
to chrome. Collegue sent me a link to arch wiki, which suggested turning off
smooth scrolling. This helped I think, but I’ve stayed with chrome for the
time being. The default firefox experience makes me really sad.
Fingerprint sensor, but hey, not like this is unexpected.
I get around 3h of regular work (compilations & build, IDE, spotify, external display, mails, slack, I have it all). It is a far cry from MBP, but acceptable. I plan to experiment with TLP to see if I’ll get more out of it. Also, I’ve haven’t got a chance to test it without IDE + sbt combo; hope it’ll be a bit better in reading / surfing mode. I’m using the discrete nvidia card.
I’ve played a bit with kubuntu and ubuntu live cds and decided to go with KDE.
But after a few days I’ve installed
ubuntu-desktop and stick with it. I like
KDE more, but the number of configuration options and perceived stability made
me switch to gnome for now.
shiftif not able to open bios.
$ sudo apt install chromium-browser
$ ubuntu-drivers devices # and if you agree with the recomendation $ sudo ubuntu-drivers autoinstall # reboot and then you can: ## check with card is in use prime-select query ## select one of them sudo prime-select intel sudo prime-select nvidia ## and reboot
glxgears on intel
$ glxgears 367 frames in 5.0 seconds = 73.211 FPS 301 frames in 5.0 seconds = 60.027 FPS 301 frames in 5.0 seconds = 60.023 FPS 301 frames in 5.0 seconds = 60.023 FPS
glxgears on nvidia
$ glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 71605 frames in 5.0 seconds = 14320.992 FPS 72945 frames in 5.0 seconds = 14588.849 FPS 73311 frames in 5.0 seconds = 14662.161 FPS C73643 frames in 5.0 seconds = 14728.479 FPS
cd ~/Downloads sudo apt install curl curl -O https://prerelease.keybase.io/keybase_amd64.deb curl -O https://prerelease.keybase.io/keybase_amd64.deb.sig curl -O https://keybase.io/docs/server_security/code_signing_key.asc gpg --import code_signing_key.asc gpg --verify keybase_amd64.deb.sig keybase_amd64.deb sudo dpkg -i keybase_amd64.deb sudo apt-get install -f run_keybase Restart was needed to fix a permission issue while cloning a git repo
# Go to https://fonts.google.com/specimen/Source+Code+Pro # Select this font # Download $ mkdir -p ~/.fonts/Source_Code_Pro $ unzip Source_Code_Pro.zip -d ~/.fonts/Source_Code_Pro $ fc-cache -f -v
$ sudo add-apt-repository ppa:kelleyk/emacs $ sudo apt-get update $ sudo apt install emacs26 $ git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d $ cd ~/.emacs.d $ git checkout develop
$ sudo apt install git $ cd ~/code $ git clone keybase://<my-dotfiles-repo> $ cd dotfiles $ make do-bootstrap $ make force-install
Install from the toolbox https://www.jetbrains.com/toolbox/app/
As per the instructions in https://www.spotify.com/pl/download/linux/
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90 $ echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list $ sudo apt update $ sudo apt install spotify-client # There was a problem with scaling, spotify don’t honor the gnome scaling factor $ sudo emacs /usr/share/applications/spotify.desktop # Exec=spotify --force-device-scale-factor=2.0 %U
I’m really happy with the new machine, it can handle a lot of load and the setup was surprisingly easy. If they fix my airpods and improve the hidpi and external monitor support I think this will be the year of linux on the laptops.