Programming 'ON' the Pixel Slate

📅 December 20, 2018

👷 Chris Power

Context

I recently wrote a post on why I enjoy programming on the Pixel Slate. The post was meant to be a philosophical discussion on why I enjoy using the new chrome tablet as a programming device. I lauded its versatility — being able to run linux, android, and chrome apps on one machine, its compact size, and it’s overall performance. I was; however, warmly reminded by very kind people that the post had one major flaw: I was not programming ON the Pixel Slate. Thanks to these kind words of encouragement, I decided to do a bit more research, and actually code on the Pixel Slate itself; noting the Slate’s performance and usability as a local programming device.

Kind words of encouragement

In other words, he doesn’t program on a pixel slate. He uses it as a replacement for keyboard and monitor for the machine he really programs on.

You aren’t programming on the slate. You’re connecting to another PC. You could have bought any laptop.

I too could program on any network connected device with ssh client.

Yeah as someone who programs… that’s some bullshit right there.

This is what keeps me going on my darkest days...


With a warm heart and a newfound sense of purpose, let’s begin

When setting up a new programming environment, There are three main things that you need.

  1. Necessities: All the behind-the-scenes tooling and libraries you need.
  2. Editors: The windows where you get to type the text that powers the world!
  3. A Project: Something for you to actually work on.

But before we begin, We enable linux

The first thing you need to do is enable linux apps on your chrome device through Crostini. To enable linux apps, simply go to settings -> linux, and click to install linux (Beta). Once the install completes, you’ll have a working debian VM and a Terminal app to use.

Part 1: Necessities

  1. Open up the terminal installed through Crostini, or install a terminal that you like.
  2. From here, you can do any customizations you like. Install dotfiles, ZSH themes, the world is your oyster.
  3. git Install it as you would any other debian package with apt-get install git
  4. asdf asdf is a great manager for binaries such as ruby, node, etc… I use it for all my projects and so far love it. you’ll want to install this by following their documentation: https://github.com/asdf-vm/asdf
  5. node I am currently working with a client on a large react application, so node is essential here. You’ll want to install asdf-node and follow these directions: https://github.com/asdf-vm/asdf-nodejs. once finished, install the latest LTS node asdf install nodejs 10.14.2
  6. next clone a repo and you’re ready to get to work.

Part 2: Editors

VSCode

  1. go to the VSCode downloads page here: https://code.visualstudio.com/download and click on the .deb download. Crostini runs debian, so that is what you want. vscode page
  2. drag and drop: drag the downloaded file to the ‘linux files’ section of your files.
  3. right click and select ‘install linux package’ or whatever it says install vs code linux
  4. all done! you have VS code!! vs code running

WebStorm

pretty much just follow the linux instructions: https://www.jetbrains.com/help/webstorm/install-and-set-up-product.html

  1. install openJDK sudo apt install openjdk-8-jdk
  2. go to the downloads page of jetbrains webstorm and download linux tar file downloading-webstorm
  3. move tar file over to your linux files webstorm downloaded
  4. unpack tar file in terminal, and run the .sh script. Optionally, you can create a desktop entry to run this like any other app in chrome os. But I won’t get into that here webstorm running

Vim

vim is about as straightforward as it could possibly get here. Crostini appears to install a modern version of vim (8.0.707 as of this writing), so you’re good to go. You most likely have your own dotfiles if you’re a vim person. Either way, its all ready to run for you.

Part 3: Lets get to work

For my purposes, I am working on this here blog. This is a gatsby site, which means we’re working with react.

you can open your terminal, and cd to the directory and run code . OR you can just open the vscode application as you would any other app, and open the directory from there.

Once you’re in, you’re all set and ready to work. Install your dependencies via NPM/Yarn as you would any other linux/unix system, and you’re off to the races. running yarn

Only issues I’ve seen so far. You have to use the Crostini VM to connect to localhost with some things like express in node. which is easy enough. just run hostname -I in your terminal to check the IP of your VM and use that instead of localhost.

Conclusion

Is this setup quirky? yes. But its REALLY nice to have native linux running on Chrome OS. It allows you to set up your environment the way you would any other linux machine, yet, you have Chrome OS running on top of it! And the form factor of the slate is just amazing; which is the real reason why I chose it in the first place.

One more thing to note: These programs run in a BETA version of a linux VM. So there are some slight issues that you would expect out of such a setup. Namely, The performance of VSCode and WebStorm don’t feel 100% perfect (Vim on the other hand runs just fine), but its pretty close. And Google is only going to improve the native linux app experience moving forward; I’m sure we’ll get native feeling apps soon. Nonetheless; I find this to be a very compelling first-draft of what the future of Chrome OS holds. The Slate held up very well when running Terminal, VSCode, and Webstorm; along with multiple chrome tabs and windows. And hey, I even wrote this blog post from a locally running instance of WebStorm.


Like what you read?

Check out some other posts