Linux on the Razer Blade Stealth

Linux on the Razer Blade Stealth

Like many other developers frustrated with Apple’s declining interest in Mac, I’v decided to return to linux for my laptop. This is prompted in part by the significant cost difference between Apple laptops and other brands, and I’m just not excited by anything Apple has made recently. So the remained of this post will cover my experience switching to linux for my laptop.

 

My Previous Setup

When on the mac, I used many of the great builtin apps, many third party apps, and a few cloud apps.

Builtin:

  • Preview – this app is so good, its almost worth sticking with Apple just for it. It can really do almost anything. Preview Team: I love you.
  • Apple Mail – I know a lot of people hate it, but I think its great.
  • Safari – Yup, I’m a Safari person too. Chrome is great, but I’ve always been a bit more partial to Safari.
  • Terminal – Once you get it customized, its actually a pretty great terminal app.

 

3rd Party:

  • Sublime Text 3 – Combined with Package Control, this editor is awesome.
  • brew – This is where I get all my commandline apps from.
  • Illustrator – I have a love/hate relationship with Illustrator. It is so powerful, and yet the workflows for many things are so annoying.
  • Slack – I use it work for and for many social and professional groups. RIP IRC.
  • Arduino – I don’t use the IDE, just the commandline tools that are packaged inside.
  • OpenSCAD – Great 3D modeling tool if you know how to code.
  • Photoshop – Another love/hate relationship, but I use it so much less than illustrator, it ends up not being that important.
  • Saleae Logic – I wish I had more opportunities to use this fantastic logic analyzer.
  • Audacity – I don’t do too much audio editing anymore, but I still like this handy app for the rare occasion.
  • Cadsoft Eagle – Its been too long since I’ve opened it up, but I have spent many hours in this tool.

 

Cloud:

  • Google Docs – I think  spend too much time using these tools.

 

And of course there are many more apps that I use for one off purposes, but none of them seem critical enough to my everyday workflows to be concerned with for now.

 

Picking a New Laptop

My requirements:

  • 16GB RAM
  • Kaby Lake CPU
  • 512GB SSD
  • Lightweight
  • Good battery life
  • Good price
  • Type-A USB Port (at least one)
  • Headphone jack

Nice to Haves:

  • Thunderbolt
  • SD card reader (had to give this one up, but I bought a tiny micro-SD reader)
  • HDMI
  • Keyboard with backlight

 

I considered the Dell XPS 13 Developer Edition, the Lenovo X1 Carbon, and the Razer Blade Stealth. Looking at the reviews online, prices, and other people’s experiences running linux on them, I chose the Razer Blade Stealth. The Dell XPS seems like a very strong candidate too. And in hind site, it would have been better if I could have compared the two side by side. I think the Dell’s borderless screen may give it an edge over the razer.

 

Overall Impression

The Good

The razer is a really nice laptop. The build quality is great and the specs are exactly what I was looking for. After running linux on it for a little over a month, I can say that many of my workflows are actually improved. The desktop environment is customized to my exact style of working and I haven’t yet missed anything about my previous OSX setup.

Working with Arduinos, Raspberry Pis, and other embedded systems is much nicer on linux. The usb drivers are more stable and installing all the libraries I needed was a breeze. I also used this opportunity to switch to platform.io. This has been an awesome experience.

Speaking of installing software. I had forgotten how awesome apt/dpkg are. Grabbing new libraries and packages is so much better than Apple’s app store and brew. I can grab anything in seconds, all from the terminal (which is where I already spend a lot of time). Don’t get me wrong, brew is great, but it does not completely handle working around Apple’s ecosystem.

Another big switch for me was the email client. I started with Thunderbird. I was not happy. Then I tried Nylas and wow, that is a nice email client. I’m super happy now. Better than Apple Mail even.

Switching to Chrome (technically Chromium) has also been fine. Everything works great, performance is great, and with Chromium I get hardware accelerated video playback!

Battery Life seems great. I chose the QHD screen and I’m getting up to 9 hours of battery life. Heavily dependent on what I’m doing with the laptop of course. I should really do some better testing here, but to be honest, it hasn’t been a concern yet. The battery life has been better than my previous mac. All the linux power management stuff worked out of the box with one exception regarding lid close/open events (see below).

Chroma even works too. Yes all that fancy RGB LED keyboard stuff even works in linux. I installed Polychromatic and the associated drivers and boom. Everything works.

The touchscreen works perfectly out of the box, pinch zoom, all that stuff. I don’t really use it very often however.

The Bad

There are some drawbacks. The biggest is that the touchpad is not as great as the mac. I’m using libinput with Xorg and have configured it to work reasonably well for me, but I still think Apple does a better job at input rejection. The razer’s touchpad also requires a little more force to click than I’d like (I don’t use tap to click because of the less than awesome input rejection in linux). So, how big of an inconvenience is it? Its mildly annoying at this point, but I’m also excited for libinput 1.7 which is supposed to add some additional sensitivity controls.

The other drawback of the razer is the huge bezel. At first I didn’t mind, and even still its only a mild annoyance. I think the biggest issue is that it makes the screen “feel” smaller than it is.

Finally, for those who care about using their laptop as a boombox, the speakers are not very loud at all. It doesn’t bother me because I’m not looking for a thumping sound system in my laptop. Just get some headphones already or bluetooth to your stereo.

Wifi with the Killer Wireless card is terrible. I could only get 2.4Ghz working and even then it sometimes looses the connection. This would be my biggest complaint, but it has a convenient and easy $30 fix. I bought the Intel 8260 m.2 card and a T5 torx. Turned off the laptop, took the bottom cover off, installed the new card and rebooted. The Intel card not only works flawlessly, but after wakeup, it connects to networks much faster than even my mac. Problem solved! Also, did you know you can get 4G m.2 cards? crazy.

 

Installing Debian

Note: This is not a tutorial, its really more of a brief on what you can expect if you follow this path.

I’ve been a Debian fanboy since 2001. It’s the most intuitive distro to me despite using Redhat for many more years. Debian however does not have a great out of the box experience. It takes some time and effort to get everything setup and dialed in. One of my favorite parts of Debian is that you can set it up to follow a rolling release. I installed sarge and then switched apt to point at “testing” which will continually move forward without me needing to do any major re-installs or anything. I used to run like this back in the early 2000’s and it was a beautiful thing.

There are some pain points when installing Debian. The installer does not include drivers for the wireless card or the touchpad. This can be solved by using another computer and copying them over once the installer is running (it even has a prompt for this). And luckily, the touchscreen works out of the box, so its easy enough to just use it in place of the touchpad while installing. Once the distro is installed the touchpad should work out of the box.

I also got into a weird disk setup loop when trying to setup the partitions and encrypted disk. The trick is to select everything correctly the first time and never click the back button (or just restart the installer if you get into a similar situation).

After installing the basic distro, there is a lot still to do. This is when I setup the following things:

apt install

  • Xorg (not wayland)
  • Xfce (not gnome. What happened to you gnome?)
  • gdm greeter (its still the best even 16 years later!)
  • plymouth graphical boot screen (purdy and has a nice disk password prompt. Its only on the screen for about 1sec longer because the system boots so fast)
  • InkScape (Illustrator replacement, and I can customize my workflows!)
  • Chromium
  • Synapse (awesome app launcher similar to spotlight. Bind it to the windows key. amazing!)

Require Additional apt repos

  • polychromatic (razer keyboard lights)
  • Razer chroma drivers
  • lollypop (great music player)
  • Nylas (awesome email client)

Direct Downloads

  • Chrome (to get the drm binary to copy into Chromium)
  • Slack
  • Sublime Text 3
  • Saleae Logic

Note the small number of direct downloads. Pretty amazing.

Misc Razer Issues/Workarounds

Lid Open/Close Handling

ACPI is a notoriously complex and hard to implement system. Out of the box, the razer does not properly sleep/resume when closing/opening the lid. Here is the workaround I used. With that in place, all is well!

Wifi

I tried and tried and tried to get 5Ghz working with the built-in killer wireless card. I think I must have read every bug and thread on the subject. At the end of the day the best solution was to spend $30 and 10minutes of my time to replace the card. No usb dongles or adapters. Just a new Intel 8260 m.2 wireless card. The Intel card is a direct replacement for the builtin killer card and it works flawlessly. Thank you Intel!

Touchpad

As I already noted. The installer itself does not include drivers for the touchpad, but they are included in the base Debian distro. So it will start working after the initial install is complete. Tuning the touchpad to my preferences took a little work and there don’t seem to be great GUI tools for this. I added the following file to improve my experience:

/etc/X11/xorg.conf.d/11-libinput.conf

# Match on all types of devices but tablet devices and joysticks
Section "InputClass"
 Identifier "libinput pointer catchall"
 MatchIsPointer "on"
 MatchDevicePath "/dev/input/event*"
 Driver "libinput"
EndSection

Section "InputClass"
 Identifier "libinput keyboard catchall"
 MatchIsKeyboard "on"
 MatchDevicePath "/dev/input/event*"
 Driver "libinput"
EndSection

Section "InputClass"
 Identifier "libinput touchpad catchall"
 MatchIsTouchpad "on"
 MatchDevicePath "/dev/input/event*"
 Driver "libinput"
 Option "Tapping" "off"
 Option "ClickMethod" "clickfinger"
 Option "NaturalScrolling" "true"
 Option "DisableWhileTyping" "true"
EndSection

Section "InputClass"
 Identifier "libinput touchscreen catchall"
 MatchIsTouchscreen "on"
 MatchDevicePath "/dev/input/event*"
 Driver "libinput"
EndSection

Section "InputClass"
 Identifier "libinput tablet catchall"
 MatchIsTablet "on"
 MatchDevicePath "/dev/input/event*"
 Driver "libinput"
EndSection

I’m hopeful the touchpad experience will continue to improve on linux.

 

Webcam

Seems glitchy. That said, I’ve only tried opening the cheese app. This really isn’t something I use. One day I’ll probably try it out for longer than 5 seconds.

 

Final Thoughts

The Razer is a great laptop. I like it ALOT. Its also much cheaper than a Mac. Getting Debain setup and working well took some serious work, but then again so did the Mac when I first switched to it 14 years ago. Overall, I would rate my experience with linux on the razer as about equivalent to the mac. Some things are better, some are worse. But did I mention the razer is much cheaper? I think if I can get the touchpad just a hair better, the razer + linux will become strictly better than my previous mac. Maybe I should start contributing to libinput and Xorg 😉

P.S. My first boot with the Razer was into windows 10. The out of the box experience there was pretty amazing. I migrated the windows install onto a 128G thumbdrive just in case.