Terminal and shell prompt customization

Do you want your terminal prompt to look like a pro?

sample pic! Not loaded

Installation steps.

  1. Install powerline-shell through pip3 install powerline-shell (and maybe fonts?!)
  2. Do this
    sudo apt-get install fonts-powerline
    

    or

$ wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
$ mv PowerlineSymbols.otf ~/.local/share/fonts/
$ fc-cache -vf ~/.local/share/fonts/
  1. Append below contents to the end of ~/.bashrc file.
    function _update_ps1() {
    PS1=$(powerline-shell $?)
    }
    if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then
    PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
    fi
    
  2. Restart terminal using source ~/.bashrc

Custom

$ mkdir -p ~/.config/powerline-shell && \
powerline-shell --generate-config > ~/.config/powerline-shell/config.json

Edit this file as mine below!

{
  "segments": [
    "virtual_env",
    "username",
    "hostname",
    "ssh",
    "cwd",
    "git",
    "hg",
    "jobs",
    "battery",
    "time",
    "root"
  ],
  "cwd": {
    "max_depth": 2,
    "full_cwd": "true"
  },
  "vcs": {
    "show_symbol": "true"
  },
  "time": {
    "format": "%H:%M"
  },
  "theme": "default"
}

or my remote config with custom theme. Themes available are

{
  "segments": [
    "virtual_env",
    "hostname",
    "newline",
    "username",
    "ssh",
    "cwd",
    "git",
    "hg",
    "jobs",
    "root"
  ],
  "mode": "patched",
  "cwd": {
    "max_depth": 2,
    "full_cwd": "true"
  },
  "theme": "washed" ,
  "vcs": {
    "show_symbol": "true"
  }
}

I tried to achieve Rayan’s Terminal like below. But, mission not accomplished still..

Ryan Terminal Pic - NOT LOADED Cheers,

★ 3 min read · Rajesh Pandian M · linux , shell , powerline