Liquid Prompt adds smart, adaptive functionality to your Bash or Zsh shell prompt. It adds useful information to your prompt based as you need it. For example, if your battery starts running low, an orange symbol will be added to your prompt. Or, if you're working in a git or svn repository, it will show you its status. Other examples are more subtle, like trimming down the directory path to a percentage of the terminal width.
You will notice what changes, when it changes; it's a really nice surprise! There's a full list on the project's github page.
Liquid Prompt can be configured so if you don't want certain information to show up, either because you don't need it or because Liquid Prompt simply displays too much of it for your taste, you can easily disable some info from showing up by editing its configuration file.
Download the source:
mkdir ~/bin git clone https://github.com/nojhan/liquidprompt.git ~/bin/liquidprompt
Try it out
Enable for all future sessions:
cat <<EOF >> ~/.bashrc source ~/bin/liquidprompt/liquidprompt EOF
Liquid Prompt has lots of options that let you change the behaviour of features or disable them entirely. A well documented example configuration is provided. Just copy it to your home directory and tweak it to suite your needs.
cp ~/bin/liquidprompt/liquidpromptrc-dist ~/.liquidpromptrc
Some the things you might want to change are:
LP_BATTERY_THRESHOLD, the maximal value under which the battery level is displayed. The default is 75.
LP_LOAD_THRESHOLD, the minimal value after which the load average is displayed. The default is 60.
LP_PERCENTS_ALWAYS, choose to display the percentages of load/batteries along with their corresponding marks or just coloured marks.
LP_RUNTIME_THRESHOLD, the minimal 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, choose between 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.
battery status needs acpi
On linux systems,
acpi is required to provide battery status. It works out of the box on Mac systems (using
temperature status needs lm-sensors
lm-sensors is required to report temperature status. Unfortunately, Apple seem to constantly change the sensor output, so its difficult to provide a reliable means of getting a temperature reading on macs.
performance issues with vcs repositories
I personally haven't any problems yet, but some users report performance issues when browsing large subversion or git repositories. Likewise, the author reports that you may face performances decrease when using VCS located in remote directories. To avoid that, you can set the
LP_DISABLED_VCS_PATH variable to a list of absolute and colon (":") separated paths where VCS-related features will be disabled.