Install Oh my bash

Share on:

Oh My Bash is a delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

At the end of this blog post, your command line should look similar to the image below:

:inline

In the image:

  • Blue: indicates a non git based directory/subdirectory
  • Green: indicates a git based directory in sync with the remote
  • Orange: indicates a git based directory with changes to be applied

Bash Configuration

  1. Configure Zsh/Bash shell with user based themes to make the command line visually appealing.

Install system fonts

  1. Fonts can be downloaded from here - follow example below to install them on host (install.sh)

    1wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
    2sudo mv PowerlineSymbols.otf /usr/share/fonts/
    3sudo fc-cache -vf
    4sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/
    

    Note: This configuration can be applied to local terminal setting and also the cloudtop SSH connection.

Package Configuration

  1. Update your machine

    1sudo apt -y update && sudo apt -y upgrade
    
  2. Install the powerline fonts

    1sudo apt-get install fonts-powerline
    

Install Oh-My-Bash

  1. Install oh-my-bash

    1bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
    

    The command line will update to look like below:

    :inline

  2. Add agnoster theme

    1git clone https://github.com/agnoster/agnoster-zsh-theme.git ~/.oh-my-bash/custom/themes/agnoster
    
  3. Make the following amendments in your "~/.bashrc" configuration file and amend the theme to use Agnoster

    1#echo $RANDOM_THEME
    2#OSH_THEME="font"
    3OSH_THEME="agnoster"
    

    NOTE: If the RANDOM_THEME is set, it will load a random theme each time oh-my-zsh is loaded.

  4. Reload the environment

    1source ~/.bashrc
    
  5. Your command line should now look like below:

    :inline

    NOTE: The command line will now recognize git folders and distinguish between these and normal folders

Configure ChromeOS

ChromeOS Post v84.4147.136

  1. Exit the Crosh browser tab

  2. Restart the Terminal window

    On Restart of the terminal will be using the updated font selection and theme!

ChromeOS - pre v84.4147.136

  1. In the browser, open a terminal tab and press

    1CTRL-ALT-T
    
  2. From the terminal tab, alter the look/behaviour by pressing

    1CTRL-SHIFT-P
    
  3. Find the appearance settings, then go to the font-family and enter your new font option (list of fonts is available here) e.g.

    • "Liberation Mono", monospace
  4. Now select the custom-css (URI) entry and change the default “https://example.com/some/file” contents to the following:

    1https://cdn.jsdelivr.net/gh/wernight/powerline-web-fonts@ba4426cb0c0b05eb6cb342c7719776a41e1f2114/PowerlineFonts.css
    
  5. Exit the appearance setting screen

  6. Exit the Crosh browser tab

  7. Restart the Terminal window

Restarting the terminal will update the font selection and theme!