2014-12-09 01:27:11 -05:00
|
|
|
|
Liquid Prompt — a useful adaptive prompt for Bash & zsh
|
|
|
|
|
=======================================================
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Liquid Prompt gives you a nicely displayed prompt with useful information
|
2013-04-22 12:11:41 -04:00
|
|
|
|
when you need it. It shows you what you need when you need it.
|
2014-12-09 01:27:11 -05:00
|
|
|
|
You will notice what changes *when* it changes, saving time and frustration.
|
|
|
|
|
You can even use it with your favorite shell – Bash or zsh.
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2012-08-16 13:47:41 -04:00
|
|
|
|
![Screenshot](https://raw.github.com/nojhan/liquidprompt/master/demo.png)
|
2012-08-13 03:35:50 -04:00
|
|
|
|
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
## Features
|
|
|
|
|
|
|
|
|
|
If there is nothing special about the current context, the appearance of Liquid
|
|
|
|
|
Prompt is similar to that of a default prompt:
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
|
|
|
|
`[user:~] $ `
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
If you are running a background command and are also in the "myb" branch
|
|
|
|
|
of a Git repository on a server:
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
|
|
|
|
`1r [user@server:~/liquidprompt] myb ± `
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
When Liquid Prompt is displaying everything (a rare event!), it may look like this:
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2013-04-20 15:51:55 -04:00
|
|
|
|
`code 🕤 ⌁24% ⌂42% 3d/2&/1z [user@server:~/ … /code/liquidprompt][pyenv]↥ master(+10/-5,3)*+ 125 ± `
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Here is an overview of what Liquid Prompt is capable of displaying:
|
|
|
|
|
|
|
|
|
|
* a tag associated to the current shell session (you can easily add any
|
|
|
|
|
prefix tag to your prompt by invoking `prompt_tag MYTAG`)
|
|
|
|
|
* the current time, displayed as either numeric values or as an analog clock
|
|
|
|
|
* the current battery status:
|
|
|
|
|
* a green `⏚` if charging, above the given threshold, but not charged
|
|
|
|
|
* a yellow `⏚` if charging and under the given threshold
|
|
|
|
|
* a yellow `⌁` if discharging but above the given threshold
|
|
|
|
|
* a red `⌁` if discharging and under the given threshold
|
|
|
|
|
* the remaining battery power if it is under the given threshold, displayed with
|
|
|
|
|
an increasingly red color map as remaining power decreases
|
|
|
|
|
* the average of the processors load if it is over a given limit, displayed with
|
|
|
|
|
an intensity color map as load increases
|
|
|
|
|
* the average temperature of the available system sensors (generally CPU and MB)
|
|
|
|
|
* the number of detached sessions (`screen` or `tmux`)
|
2012-07-19 08:48:20 -04:00
|
|
|
|
* the number of attached sleeping jobs (when you interrupt a command with Ctrl-Z
|
2014-12-09 01:27:11 -05:00
|
|
|
|
and bring it back with `fg`)
|
|
|
|
|
* the number of attached running jobs (commands started with a `&`)
|
2013-02-26 08:18:58 -05:00
|
|
|
|
* a pair of square brackets, in blue if your current shell is running in a
|
2014-12-09 01:27:11 -05:00
|
|
|
|
terminal multiplexer (`screen` or `tmux`)
|
|
|
|
|
* the current user, in bold yellow if it is root and in light white if it is not
|
|
|
|
|
the same as the login user
|
|
|
|
|
* a green `@` if the connection has X11 support; a yellow one if not
|
|
|
|
|
* the current host – in bold red if you are connected via a `telnet` connection
|
|
|
|
|
and blue (or other unique colors) if connected via SSH
|
|
|
|
|
* a green colon if the user has write permissions in the current directory and
|
|
|
|
|
a red one if not
|
|
|
|
|
* the current directory in bold, shortened if it takes too much space while always
|
|
|
|
|
preserving the first two directory names
|
|
|
|
|
* the current Python virtual environment
|
|
|
|
|
* an up arrow if an HTTP proxy is in use
|
2012-07-19 08:17:32 -04:00
|
|
|
|
* the name of the current branch if you are in a version control repository
|
2014-12-09 01:27:11 -05:00
|
|
|
|
(Git, Mercurial, Subversion, Bazaar, or Fossil):
|
|
|
|
|
* in green if everything is up-to-date
|
|
|
|
|
* in red if there are changes
|
|
|
|
|
* in yellow if there are pending commits to push
|
2013-05-20 10:47:31 -04:00
|
|
|
|
* the number of added/deleted lines if changes have been made and the
|
2014-12-09 01:27:11 -05:00
|
|
|
|
number of pending commits
|
|
|
|
|
* a yellow `+` if there are stashed modifications
|
|
|
|
|
* a red `*` if there are untracked files in the repository
|
|
|
|
|
* the runtime of the last command, if it has exceeded a certain threshold
|
|
|
|
|
* the error code of the last command, if it has failed in some way
|
|
|
|
|
* a smart mark at the end of the prompt:
|
|
|
|
|
* `±` for Git
|
|
|
|
|
* `☿` for Mercurial
|
|
|
|
|
* `‡` for Subversion
|
|
|
|
|
* `‡±` for Git-Subversion
|
|
|
|
|
* `⌘` for Fossil
|
|
|
|
|
* `$` or `%` for a simple user
|
|
|
|
|
* a red `#` for the root user
|
|
|
|
|
* if desired, the prompt will be replicated in your terminal window's
|
|
|
|
|
title (without the colors)
|
|
|
|
|
|
|
|
|
|
You can temporarily deactivate Liquid Prompt and revert to your previous prompt
|
|
|
|
|
by typing `prompt_off`. Use `prompt_on` to bring it back. You can disable
|
|
|
|
|
*all* prompts and simply use a single mark sign (`$ ` for user and `# ` for root)
|
|
|
|
|
by using the `prompt_OFF` command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Test Drive and Installation
|
|
|
|
|
|
|
|
|
|
Installation is simple. The basic dependencies are standard Unix utilities/commands.
|
|
|
|
|
If you experience some problems during the installation, please check that they
|
|
|
|
|
are met; see the [dependencies](#dependencies) section for what you need specifically.
|
2013-04-21 07:06:26 -04:00
|
|
|
|
|
|
|
|
|
Follow these steps:
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
cd
|
|
|
|
|
git clone https://github.com/nojhan/liquidprompt.git
|
|
|
|
|
source liquidprompt/liquidprompt
|
2013-04-21 07:06:26 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
To use it every time you start a shell, add the following lines to your
|
|
|
|
|
`.bashrc` (if you use Bash) or `.zshrc` (if you use zsh):
|
2013-04-21 07:06:26 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
# Only load Liquid Prompt in interactive shells, not from a script or from scp
|
|
|
|
|
[[ $- = *i* ]] && source ~/liquidprompt/liquidprompt
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Next up is the configuration; you can skip this step if you like the defaults:
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
cp ~/liquidprompt/liquidpromptrc-dist ~/.config/liquidpromptrc
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2013-04-21 07:06:26 -04:00
|
|
|
|
You can also copy the file to `~/.liquidpromptrc`.
|
2013-05-14 09:50:47 -04:00
|
|
|
|
Use your favorite text editor to change the defaults.
|
2013-04-21 07:06:26 -04:00
|
|
|
|
The `liquidpromptrc` file is richly commented and easy to set your own defaults.
|
2014-12-09 01:27:11 -05:00
|
|
|
|
You can even theme Liquid Prompt and use a custom PS1 prompt. This is explained
|
2013-04-21 07:06:26 -04:00
|
|
|
|
in the sections below.
|
2012-08-01 13:33:32 -04:00
|
|
|
|
|
2013-05-15 19:01:27 -04:00
|
|
|
|
Check in your `.bashrc` that the `PROMPT_COMMAND` variable is not set, or else
|
|
|
|
|
the prompt will not be available.
|
2013-01-17 15:44:16 -05:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
### Installation via Antigen
|
2013-07-07 18:31:58 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
To install via antigen, simply add the following line in your `.zshrc` after activating antigen:
|
2013-07-07 18:31:58 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
antigen bundle nojhan/liquidprompt
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
|
|
|
|
|
## Dependencies
|
2012-08-10 08:30:13 -04:00
|
|
|
|
|
2013-05-15 19:01:27 -04:00
|
|
|
|
Apart from obvious ones, some features depend on specific commands. If you do
|
2014-12-09 01:27:11 -05:00
|
|
|
|
not install them, the corresponding feature will not be available, but no error
|
|
|
|
|
will be displayed.
|
2012-08-10 08:30:13 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* Battery status requires `acpi` on GNU/Linux.
|
|
|
|
|
* Temperature status requires `acpi` or `lm-sensors` on GNU/Linux.
|
|
|
|
|
* Detached session status looks for `screen` and/or `tmux`.
|
|
|
|
|
* VCS support features require `git`, `hg`, `svn`, `bzr` or `fossil`, but you
|
|
|
|
|
probably already knew that.
|
2012-08-10 08:30:13 -04:00
|
|
|
|
|
|
|
|
|
For other features, the script uses commands that should be available on a large
|
2014-12-09 01:27:11 -05:00
|
|
|
|
variety of Unix systems: `tput`, `grep`, `awk`, `sed`, `ps`, `who`, and `expr`.
|
2012-08-10 08:30:13 -04:00
|
|
|
|
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
## Feature Configuration
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2013-05-15 19:01:27 -04:00
|
|
|
|
You can configure some variables in the `~/.config/liquidpromptrc` file:
|
2012-08-01 13:33:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_BATTERY_THRESHOLD`, the maximal value under which the battery level is displayed
|
2013-06-11 13:32:02 -04:00
|
|
|
|
* `LP_LOAD_THRESHOLD`, the minimal value after which the load average is displayed
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_TEMP_THRESHOLD`, the minimal value after which the average temperature is displayed
|
2013-06-11 13:32:02 -04:00
|
|
|
|
* `LP_RUNTIME_THRESHOLD`, the minimal value after which the runtime is displayed
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_PATH_LENGTH`, the maximum percentage of the screen width used to display the path
|
|
|
|
|
* `LP_PATH_KEEP`, how many directories to keep at the beginning of a shortened path
|
|
|
|
|
* `LP_HOSTNAME_ALWAYS`, a choice between always displaying the hostname or
|
|
|
|
|
showing it only when connected via a remote shell
|
|
|
|
|
* `LP_USER_ALWAYS`, a choice between always displaying the user or showing
|
|
|
|
|
it only when he is different from the one that logged in
|
|
|
|
|
|
|
|
|
|
You can also force some features to be disabled, to save some time in the
|
|
|
|
|
prompt-building process:
|
|
|
|
|
|
|
|
|
|
* `LP_ENABLE_PERM`, if you want to detect if the directory is writeable
|
2013-03-13 06:56:28 -04:00
|
|
|
|
* `LP_ENABLE_SHORTEN_PATH`, if you want to shorten the path display
|
2012-08-16 09:16:48 -04:00
|
|
|
|
* `LP_ENABLE_PROXY`, if you want to detect if a proxy is used
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_ENABLE_JOBS`, if you want to have jobs information
|
|
|
|
|
* `LP_ENABLE_LOAD`, if you want to have load information
|
|
|
|
|
* `LP_ENABLE_BATT`, if you want to have battery information
|
|
|
|
|
* `LP_ENABLE_GIT`, if you want to have Git information
|
|
|
|
|
* `LP_ENABLE_SVN`, if you want to have Subversion information
|
|
|
|
|
* `LP_ENABLE_HG`, if you want to have Mercurial information
|
|
|
|
|
* `LP_ENABLE_BZR`, if you want to have Bazaar information
|
|
|
|
|
* `LP_ENABLE_FOSSIL`, if you want to have Fossil information
|
2013-01-04 06:13:00 -05:00
|
|
|
|
* `LP_ENABLE_VCS_ROOT`, if you want to show VCS informations with root account
|
2013-01-10 11:18:45 -05:00
|
|
|
|
* `LP_ENABLE_TITLE`, if you want to use the prompt as your terminal window's title
|
2013-03-08 05:48:21 -05:00
|
|
|
|
* `LP_ENABLE_SCREEN_TITLE`, if you want to use the prompt as your screen window's title
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_ENABLE_SSH_COLORS`, if you want different colors for hosts you SSH into
|
2013-06-11 13:32:02 -04:00
|
|
|
|
* `LP_ENABLE_RUNTIME`, if you want to display the runtime of the last command
|
2013-04-20 15:51:55 -04:00
|
|
|
|
* `LP_ENABLE_TIME`, if you want to display the time at which the prompt was shown
|
2014-11-16 11:42:22 -05:00
|
|
|
|
* `LP_ENABLE_OHMYGIT`, if you want to enable [Oh My Git](https://github.com/arialdomartini/oh-my-git)
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_TIME_ANALOG`, if you want to show the time using an analog clock instead of numeric values
|
2012-08-16 09:16:48 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Note that if required commands are not installed, enabling the corresponding
|
|
|
|
|
feature will have no effect. Also, all the `LP_ENABLE_…` variables override the
|
|
|
|
|
templates; i.e. if you use `$LP_BATT` in your template and you set `LP_ENABLE_BATT=0`
|
|
|
|
|
in your configuration file, your prompt will not have any battery information.
|
2012-08-01 13:33:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
If you are using Bash and want to use the `PROMPT_DIRTRIM` built-in
|
|
|
|
|
functionality to shorten but still want to have Liquid Prompt calculating the
|
|
|
|
|
number of directories to keep in the path, precise a value for `PROMPT_DIRTRIM`
|
|
|
|
|
before sourcing Liquid Prompt and it will override this value with one fitting
|
|
|
|
|
the width of your terminal.
|
2013-01-10 04:22:58 -05:00
|
|
|
|
|
2013-04-09 17:00:05 -04:00
|
|
|
|
You may face performances decrease when using VCS located in remote directories.
|
2014-12-09 01:27:11 -05:00
|
|
|
|
To avoid this, you can set the `LP_DISABLED_VCS_PATH` variable to a list of
|
|
|
|
|
absolute colon-separated paths where VCS-related features should be disabled.
|
2013-04-09 17:00:05 -04:00
|
|
|
|
|
2013-01-10 04:22:58 -05:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
## Customizing the Prompt
|
2012-08-14 09:38:33 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
### Adding a Prefix/Postfix
|
2013-01-04 07:01:06 -05:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
You can prefix the `LP_PS1` variable with anything you want using
|
2013-01-10 11:18:45 -05:00
|
|
|
|
`LP_PS1_PREFIX`. The following example activate a custom window's title:
|
2013-01-04 07:01:06 -05:00
|
|
|
|
|
2013-01-04 08:08:26 -05:00
|
|
|
|
LP_PS1_PREFIX="\[\e]0;\u@\h: \w\a\]"
|
2012-08-14 09:38:33 -04:00
|
|
|
|
|
2013-05-03 15:06:08 -04:00
|
|
|
|
To postfix the prompt, use the `LP_PS1_POSTFIX` variable. For example, to add a
|
|
|
|
|
newline and a single character:
|
|
|
|
|
|
|
|
|
|
LP_PS1_POSTFIX="\n>"
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Note: the `prompt_tag` function is a convenient way to add a prefix. You can use
|
|
|
|
|
it to add a keyword to each of your different terminals:
|
2013-02-26 07:37:31 -05:00
|
|
|
|
|
2013-03-11 18:05:10 -04:00
|
|
|
|
[:~/code/liquidprompt] develop ± prompt_tag mycode
|
2013-02-26 07:37:31 -05:00
|
|
|
|
mycode [:~/code/liquidprompt] develop ±
|
|
|
|
|
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
### Rearranging the Prompt
|
2012-08-14 09:38:33 -04:00
|
|
|
|
|
|
|
|
|
You can sort what you want to see by sourcing your favorite template file
|
2012-09-09 17:03:39 -04:00
|
|
|
|
(`*.ps1`) in the configuration file.
|
2012-08-14 09:38:33 -04:00
|
|
|
|
|
2013-03-13 06:56:28 -04:00
|
|
|
|
You can start from the `liquid.ps1` file, which show the default settings.
|
|
|
|
|
To use your own configuration, just set `LP_PS1_FILE` to your own file path in
|
2014-12-03 13:52:35 -05:00
|
|
|
|
your `~/.liquidpromptrc` and you're done.
|
2013-03-13 06:56:28 -04:00
|
|
|
|
|
2012-08-14 09:38:33 -04:00
|
|
|
|
Those scripts basically export the `LP_PS1` variable, by appending features and
|
|
|
|
|
theme colors.
|
|
|
|
|
|
|
|
|
|
Available features:
|
|
|
|
|
* `LP_BATT` battery
|
|
|
|
|
* `LP_LOAD` load
|
2013-05-04 10:44:16 -04:00
|
|
|
|
* `LP_TEMP` temperature
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_JOBS` detached `screen` or `tmux` sessions/running jobs/suspended jobs
|
2012-08-14 09:38:33 -04:00
|
|
|
|
* `LP_USER` user
|
|
|
|
|
* `LP_HOST` hostname
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_PERM` a colon (`:`)
|
2012-08-14 09:38:33 -04:00
|
|
|
|
* `LP_PWD` current working directory
|
|
|
|
|
* `LP_PROXY` HTTP proxy
|
2013-01-23 12:26:21 -05:00
|
|
|
|
* `LP_VCS` informations concerning the current working repository
|
2012-08-14 09:38:33 -04:00
|
|
|
|
* `LP_ERR` last error code
|
|
|
|
|
* `LP_MARK` prompt mark
|
2013-05-04 11:10:10 -04:00
|
|
|
|
* `LP_TITLE` the prompt as a window's title escaped sequences
|
|
|
|
|
* `LP_BRACKET_OPEN` and `LP_BRACKET_CLOSE`, brackets enclosing the user+path part
|
2012-08-14 09:38:33 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
For example, if you just want to have a prompt displaying the user and the
|
|
|
|
|
host, with a normal full path in blue and Git support only:
|
2012-08-10 09:46:44 -04:00
|
|
|
|
|
2012-08-13 17:15:24 -04:00
|
|
|
|
export LP_PS1=`echo -ne "[\${LP_USER}\${LP_HOST}:\${BLUE}\$(pwd)\${NO_COL}] \${LP_GIT} \\\$ "`
|
2012-08-10 09:46:44 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Note that you need to properly escape dollar signs in a string that will be
|
|
|
|
|
interpreted by Bash at each prompt.
|
2012-08-10 09:46:44 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
To erase your new formatting, just bind `LP_PS1` to a null string:
|
2012-08-10 09:46:44 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
export LP_PS1=""
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
## Themes
|
2013-01-23 12:26:21 -05:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
You can change the colors and special characters of some parts of Liquid Prompt
|
|
|
|
|
by sourcing your favorite theme file (`*.theme`) in the configuration file.
|
2012-08-14 06:01:14 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
### Colors
|
2012-08-16 09:22:01 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
The available colours available for use are:
|
2012-08-14 06:01:14 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
`BOLD`, `BLACK`, `BOLD_GRAY`, `WHITE`, `BOLD_WHITE`, `GREEN`, `BOLD_GREEN`,
|
|
|
|
|
`YELLOW`, `BOLD_YELLOW`, `BLUE`, `BOLD_BLUE`, `PINK`, `CYAN`, `BOLD_CYAN,`,
|
|
|
|
|
`RED`, `BOLD_RED`, `WARN_RED`, `CRIT_RED`, `DANGER_RED`, and `NO_COL`.
|
|
|
|
|
|
|
|
|
|
Set the variable to a null string (`""`) if you do not want color.
|
2012-08-14 06:01:14 -04:00
|
|
|
|
|
|
|
|
|
* Current working directory
|
|
|
|
|
* `LP_COLOR_PATH` as normal user
|
|
|
|
|
* `LP_COLOR_PATH_ROOT` as root
|
|
|
|
|
* Color of the proxy mark
|
|
|
|
|
* `LP_COLOR_PROXY`
|
|
|
|
|
* Jobs count
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_COLOR_JOB_D` Detached (`screen` / `tmux` sessions without attached clients)
|
|
|
|
|
* `LP_COLOR_JOB_R` Running (`xterm &`)
|
2012-08-14 06:01:14 -04:00
|
|
|
|
* `LP_COLOR_JOB_Z` Sleeping (Ctrl-Z)
|
2013-02-26 08:18:58 -05:00
|
|
|
|
* `LP_COLOR_IN_MULTIPLEXER` currently running in a terminal multiplexer
|
2012-08-14 06:01:14 -04:00
|
|
|
|
* Last error code
|
|
|
|
|
* `LP_COLOR_ERR`
|
|
|
|
|
* Prompt mark
|
|
|
|
|
* `LP_COLOR_MARK` as user
|
|
|
|
|
* `LP_COLOR_MARK_ROOT` as root
|
2013-05-14 00:21:42 -04:00
|
|
|
|
* `LP_MARK_PREFIX="\n"` put the prompt on the second line
|
2012-08-14 06:01:14 -04:00
|
|
|
|
* Current user
|
|
|
|
|
* `LP_COLOR_USER_LOGGED` user who logged in
|
|
|
|
|
* `LP_COLOR_USER_ALT` user but not the one who logged in
|
|
|
|
|
* `LP_COLOR_USER_ROOT` root
|
|
|
|
|
* Hostname
|
|
|
|
|
* `LP_COLOR_HOST` local host
|
|
|
|
|
* `LP_COLOR_SSH` connected via SSH
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_COLOR_TELNET` connected via `telnet`
|
2012-09-25 15:09:51 -04:00
|
|
|
|
* `LP_COLOR_X11_ON` connected with X11 support
|
|
|
|
|
* `LP_COLOR_X11_OFF` connected without X11 support
|
2013-03-13 06:56:28 -04:00
|
|
|
|
* Separation mark (by default, the colon before the path)
|
2012-08-14 06:01:14 -04:00
|
|
|
|
* `LP_COLOR_WRITE` have write permission
|
|
|
|
|
* `LP_COLOR_NOWRITE` do not have write permission
|
2012-08-14 08:35:20 -04:00
|
|
|
|
* VCS
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_COLOR_UP` repository is up-to-date / a push has been made
|
2012-08-14 08:35:20 -04:00
|
|
|
|
* `LP_COLOR_COMMITS` some commits have not been pushed
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_COLOR_CHANGES` there are some changes to commit
|
2013-01-05 17:03:26 -05:00
|
|
|
|
* `LP_COLOR_DIFF` number of lines or files impacted by current changes
|
2012-08-14 08:35:20 -04:00
|
|
|
|
* Battery
|
|
|
|
|
* `LP_COLOR_CHARGING_ABOVE` charging and above threshold
|
|
|
|
|
* `LP_COLOR_CHARGING_UNDER` charging but under threshold
|
|
|
|
|
* `LP_COLOR_DISCHARGING_ABOVE` discharging but above threshold
|
|
|
|
|
* `LP_COLOR_DISCHARGING_UNDER` discharging and under threshold
|
2012-08-14 06:01:14 -04:00
|
|
|
|
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
### Special Characters
|
2012-08-16 09:22:01 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_MARK_DEFAULT` (default: "") the mark you want at the end of your prompt
|
|
|
|
|
(leave empty to use your shell's default mark)
|
2012-08-16 09:22:01 -04:00
|
|
|
|
* `LP_MARK_BATTERY` (default: "⌁") in front of the battery charge
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_MARK_ADAPTER` (default: "⏚") displayed when plugged-in
|
2012-08-16 09:22:01 -04:00
|
|
|
|
* `LP_MARK_LOAD` (default: "⌂") in front of the load
|
|
|
|
|
* `LP_MARK_PROXY` (default: "↥") indicate a proxy in use
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* `LP_MARK_HG` (default: "☿") prompt mark in Mercurial repositories
|
|
|
|
|
* `LP_MARK_SVN` (default: "‡") prompt mark in Subversion repositories
|
|
|
|
|
* `LP_MARK_GIT` (default: "±") prompt mark in Git repositories
|
|
|
|
|
* `LP_MARK_FOSSIL` (default: "⌘") prompt mark in Fossil repositories
|
|
|
|
|
* `LP_MARK_BZR` (default: "⚯") prompt mark in Bazaar repositories
|
|
|
|
|
* `LP_MARK_DISABLED` (default: "⌀") prompt mark in disabled repositories
|
|
|
|
|
(see `LP_DISABLED_VCS_PATH`)
|
|
|
|
|
* `LP_MARK_UNTRACKED` (default: "\*") if Git has untracked files
|
|
|
|
|
* `LP_MARK_STASH` (default: "+") if Git has stashed modifications
|
2013-02-26 08:18:58 -05:00
|
|
|
|
* `LP_MARK_BRACKET_OPEN` (default: "[") marks around the main part of the prompt
|
|
|
|
|
* `LP_MARK_BRACKET_CLOSE` (default: "]") marks around the main part of the prompt
|
2013-01-10 11:18:45 -05:00
|
|
|
|
* `LP_TITLE_OPEN` (default: "\e]0;") escape character opening a window's title
|
|
|
|
|
* `LP_TITLE_CLOSE` (default: "\a") escape character closing a window's title
|
2013-03-07 19:59:06 -05:00
|
|
|
|
* `LP_SCREEN_TITLE_OPEN` (default: "\033k") escape character opening screen window's title
|
|
|
|
|
* `LP_SCREEN_TITLE_CLOSE` (default: "\033\134") escape character closing screen window's title
|
2012-08-16 09:22:01 -04:00
|
|
|
|
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
## Known Limitations and Bugs
|
2012-07-19 08:17:32 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Liquid Prompt is distributed under the [GNU Affero General Public License
|
2014-06-28 17:10:21 -04:00
|
|
|
|
version 3](LICENSE).
|
2012-08-10 10:52:23 -04:00
|
|
|
|
|
2012-07-19 08:17:32 -04:00
|
|
|
|
* Does not display the number of commits to be pushed in Mercurial repositories.
|
2014-12-09 01:27:11 -05:00
|
|
|
|
* Browsing very large Subversion repositories may dramatically slow down
|
|
|
|
|
the display of Liquid Prompt (use `LP_DISABLED_VCS_PATH` to avoid that).
|
|
|
|
|
* Subversion repositories cannot display commits to be pushed; this is a
|
|
|
|
|
limitation of the Subversion versioning model.
|
2012-08-09 06:11:51 -04:00
|
|
|
|
* The proxy detection only uses the `$http_proxy` environment variable.
|
2013-01-10 11:18:45 -05:00
|
|
|
|
* The window's title escape sequence may not work properly on some terminals
|
2014-12-09 01:27:11 -05:00
|
|
|
|
(like `xterm-256`).
|
2014-12-04 15:48:22 -05:00
|
|
|
|
* The analog clock requires a Unicode-aware terminal and at least a
|
2014-12-09 01:27:11 -05:00
|
|
|
|
sufficiently complete font on your system. The [Symbola](http://users.teilar.gr/~g1951d/)
|
|
|
|
|
font, designed by Georges Douros, is known to work well.
|
|
|
|
|
* Displaying the runtime currently only works with Bash.
|
|
|
|
|
|
2014-08-18 18:55:04 -04:00
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
## Authors
|
2014-08-18 18:55:04 -04:00
|
|
|
|
|
|
|
|
|
Current Maintainer: [![endorse](https://api.coderwall.com/dolmen/endorsecount.png)](https://coderwall.com/dolmen)
|
|
|
|
|
|
2014-12-09 01:27:11 -05:00
|
|
|
|
Original Author: [![endorse](https://api.coderwall.com/nojhan/endorsecount.png)](https://coderwall.com/nojhan)
|
2014-11-12 16:14:35 -05:00
|
|
|
|
|
2014-08-18 18:55:04 -04:00
|
|
|
|
And many contributors!
|