Commit 6c6e1f5e authored by Olivier Mengué's avatar Olivier Mengué
Browse files

Release v1.9

parents 7f54e6de 2da289e6
nojhan <nojhan@nojhan.net> <johann.dreo@thalesgroup.com>
nojhan <nojhan@nojhan.net> <nojhan@gmail.com>
Alexander Belaev (alexbel) <alexbel@lavabit.com>
Alex Prengere <alexprengere@gmail.com> <alex.prengere@amadeus.com>
Alex Prengere <alexprengere@gmail.com> Alex <alexprengere@gmail.com>
Aurélien Requiem <aurelien@requiem.fr> <aurelien.requiem@loadedtech.com.au>
Aurélien Requiem <aurelien@requiem.fr>
Clément Mathieu <clement@unportant.info>
François Schmidts (jaesivsm) <francois.schmidts@gmail.com>
François Schmidts (jaesivsm) <francois.schmidts@gmail.com> <fschmidts@olfeo.com>
François Schmidts (jaesivsm) <francois.schmidts@gmail.com> <jaesivsm>
Frédéric Lepied <flepied@gmail.com>
Étienne Deparis <etienne@depar.is>
Étienne Deparis <etienne@depar.is> <etienne.deparis@umaneti.net>
Felix Chern (dryman) <idryman@gmail.com>
Jean-Sébastien Leroy <jean.sebastien.leroy@gmail.com>
Joris Dedieu <joris@nfrance.com>
Joris Dedieu <joris@nfrance.com> <joris@pontiac3.nfrance.com>
Julien Pecqueur <jpec@julienpecqueur.net>
Julien Pecqueur <jpec@julienpecqueur.net> <jpec80@gmail.com>
Ludovic Rousseau <ludovic.rousseau@gmail.com> <lroussea@370bh2j.(none)>
Matthew Micene (nzwulfin) <nzwulfin@gmail.com>
Nicolas Lacourte <nicolas@dotinfra.fr>
Olivier Dupuis <oj.dupuis@gmail.com>
Poil <poil@quake.fr> M.Poil <?@?>
Poil <poil@quake.fr> Poil <?@?>
Thomas Debesse <thomas.debesse@gmail.com>
Rolf Morel (polyphemus) <rolfmorel@gmail.com>
Wilson Maravilha (algaerhythm) <algaerhythm@gmail.com>
Yannack <yannack@gmail.com>
1.9 2014-11-?? dolmen (Olivier Mengué)
Bug fixes:
- Battery indicator:
* General fixes (Github #264)
* MacOS: fix for computers without battery (like iMacs) (Github
#319)
* Optimize colormap
- Temperature indicator:
* Linux: Add a guard against any future l10n of the 'acpi' command
* Linux: Fix for negative temperature values (Github #308)
- CPU load:
* Darwin/BSD: quoting fixes
- Hostname:
* Fix colorization for SSH
* Simplify chroot detection
- VCS:
- Git:
* Use --porcelain for "git status" (Github #270)
* Minir optimization (Github #266)
- Fossil:
* Cleanup and fixes (Github #274 and others)
- Subversion:
* Fix branch/tag name extraction (Github #117, #237, #293)
- Bazar:
* Fix branch name extraction
* zsh fixes (Github #303)
- Mercurial:
* General cleanup for speed and fixes
* Disabled "hg outgoing" because it is slow (Github #217)
- Shortened path:
* Bash: Fix quoting for PROMPT_DIRTRIM
- Prompt mark:
* Simplify implementation of LP_MARK_DEFAULT
- Jobs:
* Refactoring
* Fix when screen/tmux are not installed (Github #304)
- Analog clock:
* Fix hour for 12AM and 12PM (Github #273)
- Misc:
* bash: save and set 'promptvars'
* bash: workaround broken pattern substitution in bash 4.2 (Github
#289, #294, #302)
* zsh: fix restoration of the original (pre-liquidprompt) prompt
* Fix tmux detection (Github #279)
* Save IFS (Github #267)
* Fix $TERM check (Github #291)
* Various quoting fixes
* Apply some shellcheck.com suggestions
* Many, many optimizations (Github #267)
New features:
- Add vcsh support (Github #148, #287)
- Add support for Software Collections (Github #299, #300)
Thanks to Anthony Gelibert, Frédéric Mahé, Panayiotis Kkolos, Étienne
Deparis, Frençois Schmidts, Linus Wallgren, Alexander Belaev, Bartosz
Janda, Brett McBride, Chase Colman, Cosmin L. Neagu, Matthew Micene,
Vincent Lara, Wilson Maravilha and Yannack for their patches. Thanks
to all the other contributors who reported issues or proposed patches
that have not been applied.
1.8 2014-01-15 dolmen (Olivier Mengué)
1.7 2013-11-30 nojhan
1.6 2013-05-14 nojhan
1.5 2013-04-20 nojhan
1.4 2013-04-11 nojhan
1.3 2013-03-11 nojhan
1.2 2013-01-16 nojhan
1.1 2012-08-16 nojhan
1.0 2012-08-10 nojhan
0.0 2011-02-05 nojhan
This diff is collapsed.
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
......@@ -24,7 +24,7 @@ A liquid prompt displaying everything (a rare event!) may look like this:
`code 🕤 ⌁24% ⌂42% 3d/2&/1z [user@server:~/ … /code/liquidprompt][pyenv]↥ master(+10/-5,3)*+ 125 ± `
It (may) displays:
It (may) display:
* A tag associated to the current shell session (you can easily add any
prefix tag to your prompt, by invoking `prompt_tag MYTAG`).
......@@ -65,7 +65,7 @@ commits to push;
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 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;
......@@ -124,14 +124,14 @@ 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.
* battery status needs `acpi`.
* temperature status needs `lm-sensors`.
* 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.
For other features, the script uses commands that should be available on a large
variety of unixes: `tput`, `grep`, `awk`, `sed`, `ps`, `who`.
variety of unixes: `tput`, `grep`, `awk`, `sed`, `ps`, `who`, `expr`.
## FEATURES CONFIGURATION
......@@ -324,7 +324,7 @@ Special characters:
* `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_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
......@@ -336,8 +336,8 @@ Special characters:
## KNOWN LIMITATIONS AND BUGS
Liquid prompt is distributed under the GNU Affero General Public License
version 3.
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
......@@ -352,3 +352,11 @@ 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
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)
And many contributors!
......@@ -11,13 +11,18 @@
# LP_HOST hostname
# LP_PERM a colon ":"
# LP_PWD current working directory
# LP_VENV Python virtual environment
# LP_PROXY HTTP proxy
# LP_VCS the content of the current repository
# LP_ERR last error code
# LP_MARK prompt mark
# LP_TIME current time
# LP_RUNTIME runtime of last command
# LP_MARK_PREFIX user-defined prompt mark prefix (helpful if you want 2-line prompts)
# LP_PS1_PREFIX user-defined general-purpose prefix (default set a generic prompt as the window title)
# LP_PS1_POSTFIX user-defined general-purpose postfix
# LP_BRACKET_OPEN open bracket
# LP_BRACKET_CLOSE close bracket
# Remember that most features come with their corresponding colors,
# see the README.
......@@ -25,29 +30,23 @@
# add time, jobs, load and battery
LP_PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_JOBS}"
# add user, host and permissions colon
LP_PS1="${LP_PS1}[${LP_USER}${LP_HOST}${LP_PERM}"
# if not root
if [[ "$EUID" -ne "0" ]]
then
# path in foreground color
LP_PS1="${LP_PS1}${LP_PWD}]${LP_VENV}${LP_PROXY}"
# add VCS infos
LP_PS1="${LP_PS1}${LP_VCS}"
else
# path in yellow
LP_PS1="${LP_PS1}${LP_PWD}]${LP_VENV}${LP_PROXY}"
# do not add VCS infos unless told otherwise (LP_ENABLE_VCS_ROOT)
[[ "$LP_ENABLE_VCS_ROOT" = "1" ]] && LP_PS1="${LP_PS1}${LP_VCS}"
fi
LP_PS1="${LP_PS1}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}"
LP_PS1="${LP_PS1}${LP_PWD}${LP_BRACKET_CLOSE}${LP_VENV}${LP_PROXY}"
# Add VCS infos
# If root, the info has not been collected unless LP_ENABLE_VCS_ROOT
# is set.
LP_PS1="${LP_PS1}${LP_VCS}"
# add return code and prompt mark
LP_PS1="${LP_PS1}${LP_RUNTIME}${LP_ERR}${LP_MARK}"
LP_PS1="${LP_PS1}${LP_RUNTIME}${LP_ERR}${LP_MARK_PREFIX}${LP_MARK}${LP_PS1_POSTFIX}"
# "invisible" parts
# Get the current prompt on the fly and make it a title
LP_TITLE=$(_lp_title $PS1)
LP_TITLE="$(_lp_title "$LP_PS1")"
# Insert it in the prompt
PS1="${LP_TITLE}${PS1}"
LP_PS1="${LP_TITLE}${LP_PS1}"
# vim: set et sts=4 sw=4 tw=120 ft=sh:
......@@ -8,20 +8,21 @@
# characters at once.
# 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 [[ "$(locale -k LC_CTYPE | sed -n 's/^charmap="\(.*\)"/\1/p')" == *"UTF-8"* ]]; then
# If charset is UTF-8.
LP_MARK_BATTERY="⌁" # in front of the battery charge
LP_MARK_ADAPTER="⏚" # displayed when plugged
LP_MARK_LOAD="⌂" # in front of the load
LP_MARK_TEMP="θ" # in front of the temp
LP_MARK_PROXY="↥" # indicate a proxy in use
LP_MARK_HG="☿" # prompt mark in hg repositories
LP_MARK_SVN="‡" # prompt mark in svn repositories
LP_MARK_GIT="±" # prompt mark in git repositories
LP_MARK_BATTERY="⌁" # in front of the battery charge
LP_MARK_ADAPTER="⏚" # displayed when plugged
LP_MARK_LOAD="⌂" # in front of the load
LP_MARK_TEMP="θ" # in front of the temp
LP_MARK_PROXY="↥" # indicate a proxy in use
LP_MARK_HG="☿" # prompt mark in hg repositories
LP_MARK_SVN="‡" # prompt mark in svn repositories
LP_MARK_GIT="±" # prompt mark in git repositories
LP_MARK_FOSSIL="⌘" # prompt mark in fossil repositories
LP_MARK_UNTRACKED="*" # if git has untracked files
LP_MARK_STASH="+" # if git has stashs
LP_MARK_SHORTEN_PATH="…" # prompt mark in shortened paths
LP_MARK_DISABLED="⌀" # prompt mark in directory with disabled VCS info
LP_MARK_UNTRACKED="*" # if git has untracked files
LP_MARK_STASH="+" # if git has stashs
LP_MARK_SHORTEN_PATH=" … " # prompt mark in shortened paths
else
# If charset is anything else, fallback to ASCII chars
LP_MARK_BATTERY="b"
......@@ -33,19 +34,25 @@ else
LP_MARK_SVN="="
LP_MARK_GIT="+"
LP_MARK_FOSSIL="f"
LP_MARK_DISABLED="!"
LP_MARK_UNTRACKED="*"
LP_MARK_STASH="+"
LP_MARK_SHORTEN_PATH="..."
LP_MARK_SHORTEN_PATH=" ... "
fi
# Do not prefix the prompt
LP_MARK_BRACKET_OPEN="[" # open bracket
LP_MARK_BRACKET_CLOSE="]" # close bracket
#LP_MARK_DEFAULT="" # default prompt mark
LP_MARK_PREFIX=" " # prompt mark prefix
LP_PS1_PREFIX=""
LP_PS1_POSTFIX=""
# Colors
# 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,
# GREEN, BOLD_GREEN, YELLOW, BOLD_YELLOW, BLUE,
# BOLD_BLUE, PURPLE, PINK, CYAN, BOLD_CYAN
# Set to a null string "" if you do not want color.
# Current working directory
......@@ -73,13 +80,14 @@ LP_COLOR_USER_ALT="$BOLD" # user but not the one who logged in
LP_COLOR_USER_ROOT="$BOLD_YELLOW" # root
# Hostname
LP_COLOR_HOST="" # local host
LP_COLOR_SSH="$BLUE" # connected via SSH
LP_COLOR_TELNET="$WARN_RED" # connected via telnet
LP_COLOR_X11_ON="$GREEN" # connected with X11 support
LP_COLOR_X11_OFF="$YELLOW" # connected without X11 support
# Separation mark (aka permiison in the working dir)
LP_COLOR_HOST="" # local host
LP_COLOR_SSH="$BLUE" # connected via SSH
LP_COLOR_SU="$BOLD_YELLOW" # connected remotely but in new environment through su/sudo
LP_COLOR_TELNET="$WARN_RED" # connected via telnet
LP_COLOR_X11_ON="$GREEN" # connected with X11 support
LP_COLOR_X11_OFF="$YELLOW" # connected without X11 support
# Separation mark (aka permission in the working dir)
LP_COLOR_WRITE="$GREEN" # have write permission
LP_COLOR_NOWRITE="$RED" # do not have write permission
......@@ -98,7 +106,10 @@ LP_COLOR_DISCHARGING_UNDER="$RED" # discharging and under threshold
# Time
LP_COLOR_TIME="$BLUE"
# Virtualenv
# Brackets inside screen/tmux
LP_COLOR_IN_MULTIPLEXER="$BOLD_BLUE"
# Virtual environment
LP_COLOR_VIRTUALENV="$CYAN"
# Runtime
......
This diff is collapsed.
......@@ -5,8 +5,8 @@
# If you want to use different themes and features,
# you can load the corresponding files here:
#source ~/code/liquidprompt/nojhan.theme
#LP_PS1_FILE="~/code/liquidprompt/nojhan.ps1"
#source ~/.config/liquidprompt/nojhan.theme
#LP_PS1_FILE="~/.config/liquidprompt/nojhan.ps1"
#############
# BEHAVIOUR #
......@@ -33,7 +33,7 @@ LP_PATH_LENGTH=35
LP_PATH_KEEP=2
# Do you want to display the hostname, even if not connected through network?
# Defaults to 0 (do not display hostname when localy connected)
# Defaults to 0 (do not display hostname when locally connected)
# set to 1 if you want to always see the hostname
LP_HOSTNAME_ALWAYS=0
......@@ -111,6 +111,10 @@ LP_RUNTIME_THRESHOLD=2
# Recommended value is 1
LP_ENABLE_VIRTUALENV=1
# Display the enabled software collections, if any
# Recommended value is 1
LP_ENABLE_SCLS=1
# Show average system temperature
LP_ENABLE_TEMP=1
......
......@@ -108,7 +108,13 @@ nproc()
acpi()
{
echo "fake acpi $@" 1>&2
echo 'Battery 0: Discharging, 55%, 01:39:34 remaining'
if [[ "x$1" == --battery ]]; then
echo 'Battery 0: Discharging, 55%, 01:39:34 remaining'
elif [[ "x$1" == -t ]]; then
echo 'Thermal 0: ok, 36.0 degrees C'
else
return 1
fi
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment