Skip to content

Instantly share code, notes, and snippets.

@KINGSABRI
Last active September 26, 2021 23:16
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KINGSABRI/f6b2f15b54771cba49664fb296311b23 to your computer and use it in GitHub Desktop.
Save KINGSABRI/f6b2f15b54771cba49664fb296311b23 to your computer and use it in GitHub Desktop.
Install Powerline-Shell on Ubuntu

Environment

  • Kubuntu 16.04.2 TLS
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial
  • Shell environment: Bash
  • Terminal application : Konsole
  • Default console font: Monospace

References

Installation Instructions

1) Download and install Powerline-Shell

cd ~
git clone https://github.com/banga/powerline-shell.git
cd cd powerline-shell/
cp config.py.dist config.py
./install.py 

2) Install required fonts

wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mv PowerlineSymbols.otf ~/.fonts/
mkdir -p ~/.config/fontconfig/conf.d/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
fc-cache -vf ~/.fonts/

3) Bash setup

nano ~/.bashrc

Add the following to the end of the file


# Powerline shell
function _update_ps1() {
    PS1="$(~/powerline-shell/powerline-shell.py --cwd-mode dironly --cwd-max-depth 1 --cwd-max-dir-size 50 --mode patched $? 2> /dev/null)"
}
# Apply PowerShell '_update_ps1' function 
export PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"

4) Apply changes

Logout and login.

Note: if it you haven't get the proper look, change the terminal profile font

@aminelch
Copy link

is that working with Ubuntu 17.10 ?

@dmbomer
Copy link

dmbomer commented Nov 30, 2017

cd cd powerline-shell/?

@ahrherrera
Copy link

cp config.py.dist config.py ?

No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment