diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f58223..e43b309 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ How to do the right thing? # Hack, commit, hack, commit... - # Fork the project on Github (if you haven t yet) + # Fork the project on GitHub (if you haven't yet) # Add the remote target for pushes $ git remote add github git@github.com:$GITHUB_USER/liquidprompt.git @@ -44,19 +44,21 @@ How to do the right thing? # Rebase your work on the latest state of `develop` $ git rebase upstream/develop - # Push + # Push your commits $ git push github fix/my-fix $ git push github fix/my-feature - # Create the pull request on Github. Check that Github choose the `develop` + # Create the pull request on GitHub. Check that Github chose the `develop` # branch as the starting point for your branch. How to make a good pull request? -------------------------------- -1. Check that your git settings for authorship are right: - $ git config -l | grep ^user\. +1. Check that your Git authorship settings are correct: + + $ git config -l | grep ^user\. + 2. All the commits in the pull request must be on the same topic. If instead you propose fixes on different topics, use separate branches in your repo and make a pull request for each. @@ -65,8 +67,8 @@ How to make a good pull request? - second line must be empty - following lines (72 chars max) are optional and take this space freely to express what that changes does. - Use references to Github issues number (ex: `#432`) if applicable -4. Use a good title for your pull request + Use references to GitHub issues number (ex: `#432`) if applicable +4. Use a good title for your pull request. 5. Put details, web links, in the pull request body. Use Markdown fully to format the content (see [Markdown syntax](http://daringfireball.net/projects/markdown/syntax)). @@ -100,7 +102,7 @@ between pings: 1 week, 2 weeks, then every month. If a stable version is released while your pull request has still not been merged on any working branch of the main repo, it would be helpful to ease the maitainer's work by rebasing your branch on top of the latest `develop` -and push it again to your Github repo. Be careful (for example create a +and push it again to your GitHub repo. Be careful (for example create a branch or a tag before your rebase) because your may lose all your work in that process. diff --git a/README.md b/README.md index 3603e95..abe05fe 100644 --- a/README.md +++ b/README.md @@ -1,203 +1,203 @@ -Liquid prompt β€” A useful adaptive prompt for Bash & Zsh -======================================================== +Liquid Prompt β€” a useful adaptive prompt for Bash & zsh +======================================================= -Liquid prompt gives you a nicely displayed prompt with useful information +Liquid Prompt gives you a nicely displayed prompt with useful information when you need it. It shows you what you need when you need it. -You will notice what changes, when it changes saving time and frustration. -And you can even use it with your favorite shell, Bash or Zsh. +You will notice what changes *when* it changes, saving time and frustration. +You can even use it with your favorite shell – Bash or zsh. ![Screenshot](https://raw.github.com/nojhan/liquidprompt/master/demo.png) -## FEATURES -If there is nothing special in the current context, the liquid prompt is close -to a default prompt: +## Features + +If there is nothing special about the current context, the appearance of Liquid +Prompt is similar to that of a default prompt: `[user:~] $ ` -If you are running a command in the background that is still running and you are -in a git repository on a server, on branch "myb": +If you are running a background command and are also in the "myb" branch +of a Git repository on a server: `1r [user@server:~/liquidprompt] myb Β± ` -A liquid prompt displaying everything (a rare event!) may look like this: +When Liquid Prompt is displaying everything (a rare event!), it may look like this: `code πŸ•€ ⌁24% βŒ‚42% 3d/2&/1z [user@server:~/ … /code/liquidprompt][pyenv]β†₯ master(+10/-5,3)*+ 125 Β± ` -It (may) display: +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, either as numeric values or an analog clock, -* a green ⏚ if the battery is charging, above the given threshold, but not charged, -a yellow ⏚ if the battery is charging and under threshold, -a yellow ⌁ if the battery is discharging but above threshold, -a red ⌁ if the battery is discharging and under threshold; -* the average of the batteries remaining power, if it is under the given -threshold, with a colormap, going more and more red with decreasing power; -* the average of the processors load, if it is over a given limit, with a -colormap that becomes more and more noticeable with increasing load; -* the average temperature of the available sensors in the system (generally CPU -and MB); -* the number of detached sessions (`screen` or `tmux`), if there are any; +* 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`) * the number of attached sleeping jobs (when you interrupt a command with Ctrl-Z -and bring it back with `fg`), if there are any; -* the number of attached running jobs (commands started with a `&`), if there are -any; + and bring it back with `fg`) +* the number of attached running jobs (commands started with a `&`) * a pair of square brackets, in blue if your current shell is running in a -terminal multiplexer (`screen` or `tmux`); -* the current user, in bold yellow if it is root, 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, if you are connected via a telnet connection (in bold red) -or SSH (either a blue hostname or different colors for different hosts); -* a green colon if the user has write permissions on the current directory, -a red one if he has not; -* the current directory in bold, shortened if it takes too much space, while -preserving the first two directories; -* the current Python virtual environment, if any; -* an up arrow if an HTTP proxy is in use; + 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 * the name of the current branch if you are in a version control repository -(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; + (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 * the number of added/deleted lines if changes have been made and the -number of pending commits, if any; -* a yellow plus if there is stashed modifications; -* a red star if there is some 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: Β± for git directories, ☿ for mercurial, ‑ for svn, -‑± for git-svn, ⌘ for fossil, $ or % for simple user, a red # for root; -* if you ask for, the liquidprompt will be replicated in your terminal window's -title (without the colors); + 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 the liquid prompt and come back to your previous -one by typing `prompt_off`. Use `prompt_on` to bring it back. You can deactivate -any prompt and use a single mark sign (`$ ` for user and `# ` for root) with the -`prompt_OFF` command. +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 RIDE AND INSTALLATION +## Test Drive and Installation -Installation is simple. The basic dependencies are standard available on Unix. -Please check if they are met if you experience some problems during the installation. -See the DEPENDENCIES section for what you need. +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. Follow these steps: -``` -cd -git clone https://github.com/nojhan/liquidprompt.git -source liquidprompt/liquidprompt -``` + cd + git clone https://github.com/nojhan/liquidprompt.git + source liquidprompt/liquidprompt -To use it every time you start a shell add the following line to your -`.bashrc` (if you use bash) or `.zshrc` (if you use zsh): +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): -`source ~/liquidprompt/liquidprompt` + # Only load Liquid Prompt in interactive shells, not from a script or from scp + [[ $- = *i* ]] && source ~/liquidprompt/liquidprompt -Next up is the configuration, you can skip this step if you already like the defaults: +Next up is the configuration; you can skip this step if you like the defaults: -`cp ~/liquidprompt/liquidpromptrc-dist ~/.config/liquidpromptrc` + cp ~/liquidprompt/liquidpromptrc-dist ~/.config/liquidpromptrc You can also copy the file to `~/.liquidpromptrc`. Use your favorite text editor to change the defaults. The `liquidpromptrc` file is richly commented and easy to set your own defaults. -You can even theme liquidprompt and have a custom PS1. This is explained +You can even theme Liquid Prompt and use a custom PS1 prompt. This is explained in the sections below. Check in your `.bashrc` that the `PROMPT_COMMAND` variable is not set, or else the prompt will not be available. -### INSTALLATION VIA ANTIGEN +### Installation via Antigen -To install via antigen, simply add the following line in your .zshrc after activating antigen: +To install via antigen, simply add the following line in your `.zshrc` after activating antigen: -``` -antigen bundle nojhan/liquidprompt -``` + antigen bundle nojhan/liquidprompt -## DEPENDENCIES + +## Dependencies Apart from obvious ones, some features depend on specific commands. If you do -not install them, the corresponding feature will not be available, but you will -see no error. +not install them, the corresponding feature will not be available, but no error +will be displayed. -* battery status needs `acpi` on GNU/Linux. -* temperature status needs `acpi` or `lm-sensors` on GNU/Linux. -* detached sessions is looking for `screen` and/or `tmux`. -* VCS support features needs… `git`, `hg`, `svn`, `bzr` or `fossil`, but you -knew it. +* 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. For other features, the script uses commands that should be available on a large -variety of unixes: `tput`, `grep`, `awk`, `sed`, `ps`, `who`, `expr`. +variety of Unix systems: `tput`, `grep`, `awk`, `sed`, `ps`, `who`, and `expr`. -## FEATURES CONFIGURATION +## Feature Configuration You can configure some variables in the `~/.config/liquidpromptrc` file: -* `LP_BATTERY_THRESHOLD`, the maximal value under which the battery level is -displayed +* `LP_BATTERY_THRESHOLD`, the maximal value under which the battery level is displayed * `LP_LOAD_THRESHOLD`, the minimal value after which the load average is displayed -* `LP_TEMP_THRESHOLD`, the minimal value after which the temperature average is -displayed +* `LP_TEMP_THRESHOLD`, the minimal value after which the average temperature is displayed * `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 -* `LP_PATH_KEEP`, how many directories to keep at the beginning of a shortened -path -* `LP_HOSTNAME_ALWAYS`, choose between always displaying the hostname or showing -it only when connected with a remote shell -* `LP_USER_ALWAYS`, choose between always displaying the user or showing -it only when he is different from the logged one +* `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: -* `LP_ENABLE_PERM`, if you want to detect if the directory is writable +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 * `LP_ENABLE_SHORTEN_PATH`, if you want to shorten the path display * `LP_ENABLE_PROXY`, if you want to detect if a proxy is used -* `LP_ENABLE_JOBS`, if you want to have jobs informations -* `LP_ENABLE_LOAD`, if you want to have load informations -* `LP_ENABLE_BATT`, if you want to have battery informations -* `LP_ENABLE_GIT`, if you want to have git informations -* `LP_ENABLE_SVN`, if you want to have subversion informations -* `LP_ENABLE_HG`, if you want to have mercurial informations -* `LP_ENABLE_BZR`, if you want to have bazaar informations -* `LP_ENABLE_FOSSIL`, if you want to have fossil informations +* `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 * `LP_ENABLE_VCS_ROOT`, if you want to show VCS informations with root account * `LP_ENABLE_TITLE`, if you want to use the prompt as your terminal window's title * `LP_ENABLE_SCREEN_TITLE`, if you want to use the prompt as your screen window's title -* `LP_ENABLE_SSH_COLORS`, if you want different colors for hosts you SSH in +* `LP_ENABLE_SSH_COLORS`, if you want different colors for hosts you SSH into * `LP_ENABLE_RUNTIME`, if you want to display the runtime of the last command * `LP_ENABLE_TIME`, if you want to display the time at which the prompt was shown * `LP_ENABLE_OHMYGIT`, if you want to enable [Oh My Git](https://github.com/arialdomartini/oh-my-git) -* `LP_TIME_ANALOG`, when showing time, use an analog clock instead of numeric values +* `LP_TIME_ANALOG`, if you want to show the time using an analog clock instead of numeric values -Note that if required commands are not installed, enabling the -corresponding feature will have no effect. -Note also that 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 config file, you will not have the battery informations. +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. -If you are using bash and want to use the `PROMPT_DIRTRIM` built-in -functionality to shorten but still have liquidprompt calculating the number of -directories to keep in the path, precise a value for `PROMPT_DIRTRIM` before -sourcing liquidprompt and liquidprompt will override this value with one -fitting the width of your terminal. +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. 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. +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. -## CUSTOMIZING THE PROMPT +## Customizing the Prompt -### ADD A PREFIX/POSTFIX +### Adding a Prefix/Postfix -You can prefix the `LP_PS1` variable with anything you want using the +You can prefix the `LP_PS1` variable with anything you want using `LP_PS1_PREFIX`. The following example activate a custom window's title: LP_PS1_PREFIX="\[\e]0;\u@\h: \w\a\]" @@ -207,21 +207,21 @@ newline and a single character: LP_PS1_POSTFIX="\n>" -Note: the `prompt_tag` function is convenient way to add a prefix. You can thus add -a keyword to your different terminals: +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: [:~/code/liquidprompt] develop Β± prompt_tag mycode mycode [:~/code/liquidprompt] develop Β± -### PUT THE PROMPT IN A DIFFERENT ORDER +### Rearranging the Prompt You can sort what you want to see by sourcing your favorite template file (`*.ps1`) in the configuration file. 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 -your `~/.liquipromptrc` and you're done. +your `~/.liquidpromptrc` and you're done. Those scripts basically export the `LP_PS1` variable, by appending features and theme colors. @@ -230,10 +230,10 @@ Available features: * `LP_BATT` battery * `LP_LOAD` load * `LP_TEMP` temperature -* `LP_JOBS` detached screen or tmux sessions/running jobs/suspended jobs +* `LP_JOBS` detached `screen` or `tmux` sessions/running jobs/suspended jobs * `LP_USER` user * `LP_HOST` hostname -* `LP_PERM` a colon ":" +* `LP_PERM` a colon (`:`) * `LP_PWD` current working directory * `LP_PROXY` HTTP proxy * `LP_VCS` informations concerning the current working repository @@ -242,33 +242,33 @@ Available features: * `LP_TITLE` the prompt as a window's title escaped sequences * `LP_BRACKET_OPEN` and `LP_BRACKET_CLOSE`, brackets enclosing the user+path part -For example, if you just want to have a liquidprompt displaying the user and the -host, with a normal full path in blue and only the git support: +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: export LP_PS1=`echo -ne "[\${LP_USER}\${LP_HOST}:\${BLUE}\$(pwd)\${NO_COL}] \${LP_GIT} \\\$ "` -Note that you need to properly escape dollars in a string that wil be -interpreted by bash at each prompt. +Note that you need to properly escape dollar signs in a string that will be +interpreted by Bash at each prompt. -To erase your new formatting, just bring the `LP_PS1` to a null string: +To erase your new formatting, just bind `LP_PS1` to a null string: - export LP_PS1="" + export LP_PS1="" +## Themes -## THEMES +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. -You can change the colors and special characters of some part of the liquid -prompt by sourcing your favorite theme file (`*.theme`) in the configuration file. +### Colors -### COLORS +The available colours available for use are: -Available colors are: -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, -NO_COL. -Set to a null string "" if you do not want color. +`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. * Current working directory * `LP_COLOR_PATH` as normal user @@ -276,8 +276,8 @@ Set to a null string "" if you do not want color. * Color of the proxy mark * `LP_COLOR_PROXY` * Jobs count - * `LP_COLOR_JOB_D` Detached (screen/tmux sessions without attached clients) - * `LP_COLOR_JOB_R` Running (xterm &) + * `LP_COLOR_JOB_D` Detached (`screen` / `tmux` sessions without attached clients) + * `LP_COLOR_JOB_R` Running (`xterm &`) * `LP_COLOR_JOB_Z` Sleeping (Ctrl-Z) * `LP_COLOR_IN_MULTIPLEXER` currently running in a terminal multiplexer * Last error code @@ -293,16 +293,16 @@ Set to a null string "" if you do not want color. * Hostname * `LP_COLOR_HOST` local host * `LP_COLOR_SSH` connected via SSH - * `LP_COLOR_TELNET` connected via telnet + * `LP_COLOR_TELNET` connected via `telnet` * `LP_COLOR_X11_ON` connected with X11 support * `LP_COLOR_X11_OFF` connected without X11 support * Separation mark (by default, the colon before the path) * `LP_COLOR_WRITE` have write permission * `LP_COLOR_NOWRITE` do not have write permission * VCS - * `LP_COLOR_UP` repository is up to date / a push have been made + * `LP_COLOR_UP` repository is up-to-date / a push has been made * `LP_COLOR_COMMITS` some commits have not been pushed - * `LP_COLOR_CHANGES` there is some changes to commit + * `LP_COLOR_CHANGES` there are some changes to commit * `LP_COLOR_DIFF` number of lines or files impacted by current changes * Battery * `LP_COLOR_CHARGING_ABOVE` charging and above threshold @@ -311,22 +311,23 @@ Set to a null string "" if you do not want color. * `LP_COLOR_DISCHARGING_UNDER` discharging and under threshold -### CHARACTERS +### Special Characters -Special characters: -* `LP_MARK_DEFAULT` (default: "") the mark you want at the end of your prompt (leave to empty for your shell default mark) +* `LP_MARK_DEFAULT` (default: "") the mark you want at the end of your prompt + (leave empty to use your shell's default mark) * `LP_MARK_BATTERY` (default: "⌁") in front of the battery charge -* `LP_MARK_ADAPTER` (default: "⏚") displayed when plugged +* `LP_MARK_ADAPTER` (default: "⏚") displayed when plugged-in * `LP_MARK_LOAD` (default: "βŒ‚") in front of the load * `LP_MARK_PROXY` (default: "β†₯") indicate a proxy in use -* `LP_MARK_HG` (default: "☿") prompt mark in hg repositories -* `LP_MARK_SVN` (default: "‑") prompt mark in svn 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 +* `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 * `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 * `LP_TITLE_OPEN` (default: "\e]0;") escape character opening a window's title @@ -335,29 +336,29 @@ Special characters: * `LP_SCREEN_TITLE_CLOSE` (default: "\033\134") escape character closing screen window's title -## KNOWN LIMITATIONS AND BUGS +## Known Limitations and Bugs -Liquid prompt is distributed under the [GNU Affero General Public License +Liquid Prompt is distributed under the [GNU Affero General Public License version 3](LICENSE). * Does not display the number of commits to be pushed in Mercurial repositories. -* Browsing into very large subversion repositories may dramatically slow down -the display of the liquid prompt (use `LP_DISABLED_VCS_PATH` to avoid that). -* Subversion repository cannot display commits to be pushed, this is a -limitation of the Subversion versioning model. +* 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. * The proxy detection only uses the `$http_proxy` environment variable. * The window's title escape sequence may not work properly on some terminals -(like xterm-256) -* The analog clock necessitate a Unicode-aware terminal and a at least one -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 + (like `xterm-256`). +* The analog clock requires a Unicode-aware terminal and at least a + 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. -## AUTHORS + +## Authors Current Maintainer: [![endorse](https://api.coderwall.com/dolmen/endorsecount.png)](https://coderwall.com/dolmen) -Original author: [![endorse](https://api.coderwall.com/nojhan/endorsecount.png)](https://coderwall.com/nojhan) +Original Author: [![endorse](https://api.coderwall.com/nojhan/endorsecount.png)](https://coderwall.com/nojhan) And many contributors! diff --git a/example.bashrc b/example.bashrc index 68e501e..227f647 100644 --- a/example.bashrc +++ b/example.bashrc @@ -1,23 +1,23 @@ -# if you want to use the liquidprompt without bothering about its configuration, -# just: +# If you want to use Liquid Prompt without bothering about its configuration, +# just run the following command: # cp example.bashrc ~/.bashrc -# This part is a minimalist bash config file example +# The following is a minimalistic Bash config file -# Use the system config if any +# Use the system config if it exists if [ -f /etc/bashrc ]; then - . /etc/bashrc # --> Read /etc/bashrc, if present. + . /etc/bashrc # --> Read /etc/bashrc, if present. fi -# Use bash completion, if installed +# Use Bash completion, if installed if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi -# If you have your own config for the liquid prompt, edit and uncomment this line: +# If you have your own config for Liquid Prompt, edit and uncomment this line: # source /path/to/liquidpromptrc -# Use the liquidprompt +# Use Liquid Prompt source ~/.liquidprompt diff --git a/liquid.theme b/liquid.theme index 8333416..1d897f4 100644 --- a/liquid.theme +++ b/liquid.theme @@ -6,7 +6,7 @@ # Special characters # Be sure to use characters that exists in the font you use. You can use several # characters at once. -# Below is an example of how to fallback to ascii if the term is not unicode capable. +# Below is an example of how to fallback to ASCII if the term is not Unicode-capable. # Defaults to UTF-8 characters. if [[ "$(locale -k LC_CTYPE | sed -n 's/^charmap="\(.*\)"/\1/p')" == *"UTF-8"* ]]; then # If charset is UTF-8. diff --git a/liquidprompt b/liquidprompt index 01fb016..93bde0e 100755 --- a/liquidprompt +++ b/liquidprompt @@ -1,6 +1,6 @@ ################################################################################ # LIQUID PROMPT -# An intelligent and non intrusive prompt for bash and zsh +# An intelligent and non-intrusive prompt for Bash and zsh ################################################################################ @@ -181,7 +181,7 @@ unset LP_OLD_PWD # to benefit of 'local' variables. # # What we do here: -# 1. Setup variables that can be used by the user: the "API" of liquidprompt +# 1. Setup variables that can be used by the user: the "API" of Liquid Prompt # for config/theme. Those variables are local to the function. # In practice, this is only color variables. # 2. Setup default values @@ -633,9 +633,9 @@ _lp_shorten_path() fi } -# In bash shell, PROMPT_DIRTRIM is the number of directory to keep at the end +# In Bash shells, PROMPT_DIRTRIM is the number of directory to keep at the end # of the displayed path (if "\w" is present in the PS1 var). -# liquidprompt can calculate this number under two condition, path shortening +# Liquid Prompt can calculate this number under two conditions, path shortening # must be disabled and PROMPT_DIRTRIM must be already set. _lp_set_dirtrim() { local p="$(_lp_get_home_tilde_collapsed)" @@ -1323,7 +1323,7 @@ _lp_reset_runtime() # reset the runtime counter [ "$_LP_RUNTIME_COMMAND_EXECUTED" != 1 ] && _LP_RUNTIME_LAST_SECONDS=$SECONDS && _LP_RUNTIME_SECONDS=0 - # A proper command has been executed if the last command was not related to liquidprompt + # A proper command has been executed if the last command was not related to Liquid Prompt [ "$BASH_COMMAND" = _lp_set_prompt ] _LP_RUNTIME_COMMAND_EXECUTED=$? } @@ -1748,10 +1748,10 @@ prompt_tag() export LP_PS1_PREFIX="$(_lp_sr "$1")" } -# Activate the liquid prompt +# Activate Liquid Prompt prompt_on() { - # if liquidprompt has not been already set + # if Liquid Prompt has not been already set if [[ -z "$LP_OLD_PS1" ]] ; then LP_OLD_PS1="$PS1" if $_LP_SHELL_bash; then @@ -1769,7 +1769,7 @@ prompt_on() # That doesn't seem to work: no time output #if [[ "$LP_DEBUG_TIME" == 1 ]]; then # function precmd { - # local TIMEFMT='LiquidPrompt build time: %*E' + # local TIMEFMT='Liquid Prompt build time: %*E' # time _lp_set_prompt # } #else @@ -1806,7 +1806,7 @@ prompt_OFF() fi } -# By default, sourcing liquidprompt will activate the liquid prompt +# By default, sourcing liquidprompt will activate Liquid Prompt prompt_on # vim: set et sts=4 sw=4 tw=120 ft=bash syn=sh: diff --git a/liquidpromptrc-dist b/liquidpromptrc-dist index 592cb79..866a598 100644 --- a/liquidpromptrc-dist +++ b/liquidpromptrc-dist @@ -6,7 +6,7 @@ # If you want to use different themes and features, # you can load the corresponding files here: #source ~/.config/liquidprompt/nojhan.theme -#LP_PS1_FILE="~/.config/liquidprompt/nojhan.ps1" +#LP_PS1_FILE=~/.config/liquidprompt/nojhan.ps1 ############# # BEHAVIOUR # @@ -20,7 +20,7 @@ LP_BATTERY_THRESHOLD=75 # Recommended value is 60 LP_LOAD_THRESHOLD=60 -# Minimal value after which the temperature is displayed (in celsius degrees) +# Minimal value after which the temperature is displayed (in degrees Celsius) # Recommended value is 60 LP_TEMP_THRESHOLD=60 @@ -37,7 +37,7 @@ LP_PATH_KEEP=2 # set to 1 if you want to always see the hostname LP_HOSTNAME_ALWAYS=0 -# Do you want to display the user, even if he is the same than the logged one? +# Do you want to display the user, even if the user is the same as the one logged in? # Defaults to 1 (always display the user) # set to 0 if you want to hide the logged user (it will always display different users) LP_USER_ALWAYS=1 @@ -47,51 +47,51 @@ LP_USER_ALWAYS=1 # Defaults to 1 (display percentages) LP_PERCENTS_ALWAYS=1 -# Do you want to use the permissions feature ? +# Do you want to use the permissions feature? # Recommended value is 1 LP_ENABLE_PERM=1 -# Do you want to use the shorten path feature ? +# Do you want to use the shorten path feature? # Recommended value is 1 LP_ENABLE_SHORTEN_PATH=1 -# Do you want to use the proxy detection feature ? +# Do you want to use the proxy detection feature? # Recommended value is 1 LP_ENABLE_PROXY=1 -# Do you want to use the jobs feature ? +# Do you want to use the jobs feature? # Recommended value is 1 LP_ENABLE_JOBS=1 -# Do you want to use the load feature ? +# Do you want to use the load feature? # Recommended value is 1 LP_ENABLE_LOAD=1 -# Do you want to use the batt feature ? +# Do you want to use the battery feature? # Recommended value is 1 LP_ENABLE_BATT=1 -# Do you want to use vcs features with root account +# Do you want to use VCS features with the root account? # Recommended value is 0 LP_ENABLE_VCS_ROOT=0 -# Do you want to use the git special features ? +# Do you want to use the Git special features? # Recommended value is 1 LP_ENABLE_GIT=1 -# Do you want to use the svn special features ? +# Do you want to use the Subversion special features? # Recommended value is 1 LP_ENABLE_SVN=1 -# Do you want to use the mercurial special features ? +# Do you want to use the Mercurial special features? # Recommended value is 1 LP_ENABLE_HG=1 -# Do you want to use the fossil special features ? +# Do you want to use the Fossil special features? # Recommended value is 1 LP_ENABLE_FOSSIL=1 -# Do you want to use the bzr special features ? +# Do you want to use the Bazaar special features? # Recommanded value is 1 LP_ENABLE_BZR=1 @@ -125,7 +125,7 @@ LP_ENABLE_TEMP=1 # Recommended value is 0 LP_TIME_ANALOG=0 -# Use the liquid prompt as the title of the terminal window +# Use the prompt as the title of the terminal window # The content is not customizable, the implementation is very basic, # and this may not work properly on exotic terminals, thus the # recommended value is 0