Skip to content

Instantly share code, notes, and snippets.

@soakes
Forked from cassiozen/pixelbook-dev-setup.md
Created January 21, 2020 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soakes/85aa2cafafcf9f17edaad55bf9307afd to your computer and use it in GitHub Desktop.
Save soakes/85aa2cafafcf9f17edaad55bf9307afd to your computer and use it in GitHub Desktop.
Notes on setting up Pixelbook for development

Pixelbook Setup

Change your channel

Some of the features mentioned in this document only work on the beta or Dev channel. To change your channel:

  1. chrome://help in a browser window
  2. Click Detailed Build Information
  3. Change Channel
  4. Select Beta (Or Dev, if you're feeling adventurous)
  5. Wait for Chromebook to download an update then show icon in bottom left
  6. Restart when update is ready

Fast User Switching

If you have multiple accounts (Say, work and play), you can quickly sitch between them without logging out:

  1. Open the status area (the bottom-right menu)
  2. Click your account photo.
  3. Click Sign in another user.
  4. You'll see a reminder to use the feature only with people you trust. Click OK.
  5. Pick a person, then enter their password. You can add up to 7 users.

You can then quick-switch between users with CTRL+ALT+, & CTRL+ALT+.

Enable Power Button as 2FA

Pixelbook's power button has a built-in 2fa/2sv key (think YubiKey), but it's disabled by default. If you use Two-Factor authentication on GitHub, Gmail etc, you can turn it on by entering this command on the Crosh shell (Ctrl+Alt+T):

u2f_flags u2f

Linux Setup

Enable Linux Apps

  1. Open drawer in bottom right and click gear icon
  2. Scroll down to find Linux Apps or Linux (Beta) and select TURN ON
  3. After the install runs, you should have an application in ChromeOS called Terminal

Initial setup of container

sudo apt-get update && sudo apt-get dist-upgrade

Generate new SSH Key

ssh-keygen -t rsa -b 4096 -C pixelbook
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat .ssh/id_rsa.pub
# Paste in GitHub/GitLab

Set Password

sudo passwd root

Install Fonts

  • Copy .ttf file to ~/.local/share/fonts
fc-cache -vf ~/.local/share/fonts
fc-list | grep [your font name] # To verify

Enable File Sharing between Chrome OS and Linux

  1. Go to chrome://flags and turn on 'crostini-files'.
  2. Right-click on folders in FilesApp and select 'Share with Linux'
  3. Folders will show up in /ChromeOS/Downloads/ inside linux.

Applications

Crostini (the Linux container on Chrome OS) understands Debian installation packages (.deb) - You can just download any installer, drag to the "Linux files" folder using the file manager and double-click it.

And, being debian you also have apt-get.

Here are some examples

Tilix (Terminal alternative)

echo 'deb http://ftp.debian.org/debian stretch-backports main' | sudo tee /etc/apt/sources.list.d/stretch-backports.list
sudo apt update
sudo apt -y install tilix
sudo ln -s /etc/profile.d/vte-2.91.sh /etc/profile.d/vte.sh

Add to path

if [ $TILIX_ID ] || [ $VTE_VERSION ]; then
    source /etc/profile.d/vte.sh
fi

VSCode

curl -L https://go.microsoft.com/fwlink/?LinkID=760868 > code.deb
sudo apt-get install ./code.deb

HiDPI & Sommelier

The Pixelbook has a high-density display (HiDPI, roughly equivalent to the "Retina display" term if you're comming from a Mac), but not all Linux apps are prepared to appear correctly in HiDPI displays. They can appear small or have regular size with tiny cursor...

The good news is that you can use ChromeOS's built-in tool Sommelier to customize zoom levels for linux applications.

Example Sommelier setup (with Visual Studio Code)

Many installed programs will generate a .desktop file in /usr/share/applications, it contains an app description as well as its icon and launch command.

Example: /usr/share/applications/code.desktop

Change Exec entries to specify Sommelier's DPI and zoom level:

[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=sommelier -X --scale=0.7 --dpi=160 /usr/share/code/code "--unity-launch %F"
Icon=code
Type=Application
StartupNotify=true
StartupWMClass=Code
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;
Actions=new-empty-window;
Keywords=vscode;

X-Desktop-File-Install-Version=0.23

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=sommelier -X --scale=0.7 --dpi=160 /usr/share/code/code "--new-window %F"
Icon=code

Specifically for VSCode, I would also suggest adding these to your user settings

"window.titleBarStyle": "custom",
"window.zoomLevel": 2,
"editor.mouseWheelScrollSensitivity": 0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment