# 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 1. Click Detailed Build Information 1. Change Channel 1. Select Beta (Or Dev, if you're feeling adventurous) 1. Wait for Chromebook to download an update then show icon in bottom left 1. 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) 1. Click your account photo. 1. Click Sign in another user. 1. You'll see a reminder to use the feature only with people you trust. Click OK. 1. 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 1. Scroll down to find **Linux Apps** or **Linux (Beta)** and select **TURN ON** 1. After the install runs, you should have an application in ChromeOS called `Terminal` ## Initial update of container ```sh sudo apt-get update && sudo apt-get dist-upgrade ``` Note: some guides out there suggest setting the root password, but you should **never** do that. If you need to use a feature that requires a password for root, set it on the Crostini default user instead: ```sh sudo passwd ``` ## Generate new SSH Key I [prefer to use an Ed25519 key](https://bagja.net/blog/upgrade-ssh-key-to-ed25519.html). ```sh ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "my_name.pixelbook" eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 cat .ssh/id_ed25519.pub # Paste in GitHub/GitLab/etc. ``` In order to [make sure SSH agent starts automatically](https://wiki.archlinux.org/index.php/SSH_keys#SSH_agents), and that only one ssh-agent process runs at a time, add the following to `.bashrc`: ```sh if ! pgrep -u "$USER" ssh-agent > /dev/null; then ssh-agent > ~/.ssh-agent-thing fi if [[ ! "$SSH_AUTH_SOCK" ]]; then eval "$(<~/.ssh-agent-thing)" fi ``` I prefer to just after each reboot enter: ```sh ssh-add ~/.ssh/id_ed25519 ``` But there are tools I've used in Linux to automatically pop up a prompt if a key hasn't been registered with the agent. ## File Sharing Now automatic between Chrome OS and Linux. You'll find Linux files/directories in the Files app, under "Linux Files". ### Google Drive Go to the files app and right click on Google Drive, then click "Share with Linux" Files will be available under: /mnt/chomeos/Googledrive ### Slack [Download the Linux package](https://slack.com/downloads/linux). Install with Linux. If you just launch & click "Sign in" you'll eventually land at the error: "We’re sorry It looks like you are on a device that we don’t yet support." Instead just go to https://[your-channel].slack.com/ssb/signin_redirect/fallback, clock "Copy sign-in key" then launch slack, which will automatically pick up the magic key from your clipboard. Repeat for any other accounts you have. ### Dropbox Unfortunately Dropbox support for ChromeOS is poor. Main recommendation seems to be the third-party [File System for Dropbox](https://chrome.google.com/webstore/detail/file-system-for-dropbox/hlffpaajmfllggclnjppbblobdhokjhe?hl=en) but it doesn't support offline access. The official Dropbox Linux client ended support for all file systems except unencrypted ext4, which rules it out for crostini. Looking into [rclone](https://www.reddit.com/r/Crostini/comments/9g9d59/dropbox_is_dropping_support_for_all_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`. You can set up apps to be launched from icon by placing for each a desktop file in `/usr/local/share/applications/`. [Details here](https://chromium.googlesource.com/chromiumos/platform2/+/master/vm_tools/garcon/#installed-applications). ```sh sudo mkdir -p /usr/local/share/applications ``` Some examples next ### Terminal alternatives So many choices, and so manby combos of distinct and/or overlapping and/or complementary tools. I'm trying just Extraterm #### Extraterm ```sh mkdir ~/Downloads cd ~/Downloads #Update to latest release wget https://github.com/sedwards2009/extraterm/releases/download/v0.41.0/extraterm-0.41.0-linux-x64.zip wget https://github.com/sedwards2009/extraterm/releases/download/v0.41.0/extraterm-commands-0.41.0.zip cd /opt sudo unzip ~/Downloads/extraterm-0.41.0-linux-x64.zip sudo unzip ~/Downloads/extraterm-commands-0.41.0.zip sudo ln -s /opt/extraterm-0.41.0-linux-x64/extraterm /usr/local/bin/ sudo apt install libnss3 ``` Put `extraterm.desktop` in `/usr/share/applications/` to get the launcher in Chrome OS: ``` [Desktop Entry] Name=Extraterm Keywords=shell;prompt;command;commandline;cmd; Version=0.41.0 Comment=The swiss army chainsaw of terminal emulators Exec=/usr/local/bin/extraterm Icon=/opt/extraterm-0.41.0-linux-x64/resources/app/extraterm/resources/logo/extraterm_small_logo_256x256.png Type=Application ``` Add to `.bashrc` the Extraterm command for shell integration, e.g. add the line: ```sh . /opt/extraterm-commands-0.41.0/setup_extraterm_bash.sh ``` Note: [You would think](http://mywiki.wooledge.org/DotFiles) this should be added to `.profile` but for some reason Extraterm under Crostini does not run a login shell (i.e. running `shopt login_shell` yields `off`). #### Tilix ```sh 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 ```sh if [ $TILIX_ID ] || [ $VTE_VERSION ]; then source /etc/profile.d/vte.sh fi ``` #### Gnome Terminal ```sh sudo apt-get install gnome-terminal ``` Also: * Terminator * mate-terminal * combos of the above with tmux or byobu ### Text editor/IDE I was using TextMate on Mac and Atom in my Linux Mint installs. I'm not much of a fan of IDEs, but VSCode seems really popular among Pixelbook users, so I'll give it a whirl. #### Atom [Download the .deb installer from atom.io](https://atom.io/download/deb) (or the [beta version of Atom](https://atom.io/download/deb?channel=beta) if you prefer). Click "Show in folder" right click then "Install in Linux" #### VSCode Download via chrome and click through to the download location in Files app. Right click then "Install in Linux" # Supplementary info ## Install Fonts - Copy .ttf file to ~/.local/share/fonts ```sh fc-cache -vf ~/.local/share/fonts fc-list | grep [your font name] # To verify ``` ## 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. See also [this reddit thread](https://www.reddit.com/r/Crostini/comments/8vhta1/fix_for_resolution/). ### 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 ``` # Key resources * [Pixelbook keyboard shortcuts](https://support.google.com/pixelbook/answer/7503852?hl=en) * [r/Crostini subreddit Wiki](https://www.reddit.com/r/Crostini/wiki/index)--huge wealth of useful info * If your world extends beyond English-only: [Choose the keyboard language & special characters on your Pixelbook](https://support.google.com/pixelbook/answer/9134758?hl=en)