Linux - Liquidprompt an Adaptive Prompt for Bash

Linux - Liquidprompt an Adaptive Prompt for Bash

The majority of time a Linux administrator will live his/her life will be in a shell prompt and liquid prompt is a nice out of the box customisation for bash.

You can install it cloning its the git repository  :

tiago@HP-8470:~$ sudo apt install git
tiago@HP-8470:~$ git clone --branch stable ~/liquidprompt

After installed we need to edit our bash profile and add a few lines to it:

tiago@HP-8470:~ $ vim ~/.bashrc
# Only load Liquidprompt in interactive shells, not from a script or from scp
[[ $- = *i* ]] && source ~/liquidprompt/liquidprompt
Add the aboce to the end of ~/.bashrc

Let's finally source the file :

tiago@HP-8470:~ $ source ~/.bashrc

And, we now have a different prompt as seen below :

Old bash prompt

Before we finish, let's activate powerline which is a shipped theme :

[tiago@HP-8470:~] $ source ~/liquidprompt/themes/powerline/powerline.theme

And we can now use the lp_theme command to change our theme :

To have it changed permanently we need to add the below onto our ~/.bashrc below the line we have previously added :

[[ $- = *i* ]] && source ~/liquidprompt/themes/powerline/powerline.theme
[[ $- = *i* ]] && lp_theme powerline

Liquidprompt has a lot of options and checking their documentation is the way to personalise your prompt.

Share Tweet Send
You've successfully subscribed to Infoitech - [B]logging
Great! Next, complete checkout for full access to Infoitech - [B]logging
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.