In this article I will show you how to quickly install and configure Powerline to make your Linux terminal really cool 😎
âš WARNING: these steps have been tested for Debian and Ubuntu distros (they also work if used in WSL with the new Windows Terminal)
-
Install
pip3
:sudo apt-get install python3-pip
-
Install
powerline
usingpip3
:sudo pip3 install powerline-status
-
Install
powerline
fonts:sudo apt-get install fonts-powerline
For start the powerline
for each bash
session, we have to include the following content in the end of the .bashrc
file in your user's $HOME
folder:
# load powerline
if [ -f `which powerline-daemon` ]; then
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
fi
if [ -f /usr/local/lib/python3.8/dist-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python3.8/dist-packages/powerline/bindings/bash/powerline.sh
fi
For the dividers between segments, the powerline
uses some unicode glyphs that must be present in the font used by the terminal.
âš WARNING: do not forget to select fonts that are compatible with these unicode glyphs on your terminal configuration
A very cool font that I have been using, that have powerline glyphs support, is the Cascadia Code
from Microsoft, which is available on their Github for free and with open source license.
Now close the current bash
session or open a new session to see your new terminal with colors!
Now you are ready to install custom segments that can return information and make your terminal even more useful. Take a look at my other article where I made a script with some custom segments: Linux/Windows Terminal - Script to Display Random Emojis 🥴/🤬 from Commands that Return Errors