We explored several power prompts and bars for bash and vim earlier. However, Liquid Prompt deserves a special mention due to the information it shows and flexibility of customization. It takes power prompts to next level from bashstyle-ng by bringing extensive system information right at the prompt. Liquid Prompt is a script that works with bash and zsh.
Features
- The usual – custom prefix, user, host, PWD
- Numerical or analog clock
- Current battery status and remaining life (
acpi
should be installed to fetch battery status) - Average CPU load over a threshold, with intensity colour map
- Temperature of system sensors (
lm-sensors
should be installed) - Number of screen or tmux detached sessions
- Number of attached sleeping jobs (using
Ctrl-z
) and running jobs (started with&
) - Indication for screen or tmux session
- X11 support indicator
- SSH or telnet connection indicator
- Integration with several version control systems Git, Mercurial, Subversion, Bazaar, or Fossil
- Current branch status
- and lot more…
Frankly, as soon as you start sing liquid prompt you’ll be amazed.
However, this processing comes at a cost of additional time and resource to show the prompt and might lead to unresponsive behaviour on slower connections.
Installation
Get the source from GitHub and source the shell script:
$ git clone https://github.com/nojhan/liquidprompt $ source ./liquidprompt/liquidprompt
You can add the second line to your ~/.bashrc to enable Liquid Prompt permanently.
Usage
Some of the options are configurable using a config file. Copy the sample config from source first:
$ cp ./liquidprompt/liquidpromptrc-dist ~/.liquidpromptrc
Some configurable options are:
- LP_BATTERY_THRESHOLD: threshold value under which the battery level is displayed (default 75).
- LP_LOAD_THRESHOLD: threshold value over which the load average is displayed (default 60).
- LP_PERCENTS_ALWAYS: display the percentages of load/batteries along with their corresponding marks or just coloured marks.
- LP_RUNTIME_THRESHOLD: minimum value after which the runtime is displayed
- LP_PATH_LENGTH: the maximum percentage of the screen width used to display the path. The default is 35%.
- LP_HOSTNAME_ALWAYS: always displaying the hostname or showing it only when connected with a remote shell (the default).
- LP_USER_ALWAYS: choose between always displaying the user (the default) or showing it only when he is different from the logged one.
- LP_DISABLED_VCS_PATH: set to a list of absolute and
:
to disable VCS integration. Some users reported performance issues with large svn or git projects). - There are several other variables to disable certain integrations.
2 thoughts on “Liquid Prompt: power bash & zsh prompt”