More consistent special chars variable names

Basically rename LP_*_MARK to LP_MARK_* and list them in the README.
This commit is contained in:
nojhan 2012-08-16 15:22:01 +02:00
parent 991b2b38be
commit a3be8d3465
3 changed files with 46 additions and 29 deletions

View File

@ -145,10 +145,14 @@ To erase your new formatting, just bring the `LP_PS1` to a null string:
export LP_PS1=""
## COLOR THEMES
## THEMES
You can change the colors of some part of the liquid prompt by sourcing your
favorite theme file (`*.theme`), before having sourced the liquid prompt.
You can change the colors and special characters of some part of the liquid
prompt by sourcing your favorite theme file (`*.theme`), before having sourced
the liquid prompt.
### COLORS
Available colors are:
BOLD, BLACK, BOLD_GRAY, WHITE, BOLD_WHITE,
@ -194,6 +198,19 @@ Set to a null string "" if you do not want color.
* `LP_COLOR_DISCHARGING_UNDER` discharging and under threshold
### CHARACTERS
Special characters:
* `LP_MARK_BATTERY` (default: "⌁") in front of the battery charge
* `LP_MARK_ADAPTER` (default: "⏚") displayed when plugged
* `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_UNTRACKED` (default: "*") if git has untracked files
## KNOWN LIMITATIONS AND BUGS
Liquid prompt is distributed under the GNU Affero General Public License

View File

@ -10,24 +10,24 @@
# Defaults to UTF-8 characters.
if [[ "$(locale -k LC_CTYPE | sed -n 's/^charmap="\(.*\)"/\1/p')" == *"UTF-8"* ]] ; then
# If charset is UTF-8.
LP_BATTERY_MARK="⌁" # in front of the battery charge
LP_ADAPTER_MARK="⏚" # displayed when plugged
LP_LOAD_MARK="⌂" # in front of the load
LP_PROXY_MARK="↥" # indicate a proxy in use
LP_MERCURIAL_MARK="☿" # prompt mark in hg repositories
LP_SUBVERSION_MARK="‡" # prompt mark in svn repositories
LP_GIT_MARK="±" # prompt mark in git repositories
LP_UNTRACKED="*" # if git has untracked files
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_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_UNTRACKED="*" # if git has untracked files
else
# If charset is anything else, fallback to ASCII chars
LP_BATTERY_MARK="b"
LP_ADAPTER_MARK="p"
LP_LOAD_MARK="c"
LP_PROXY_MARK="^"
LP_MERCURIAL_MARK="m"
LP_SUBVERSION_MARK="="
LP_GIT_MARK="+"
LP_UNTRACKED="*"
LP_MARK_BATTERY="b"
LP_MARK_ADAPTER="p"
LP_MARK_LOAD="c"
LP_MARK_PROXY="^"
LP_MARK_HG="m"
LP_MARK_SVN="="
LP_MARK_GIT="+"
LP_MARK_UNTRACKED="*"
fi
# Colors

View File

@ -188,13 +188,13 @@ LP_PATH_LENGTH=${LP_PATH_LENGTH:-35}
LP_PATH_KEEP=${LP_PATH_KEEP:-2}
LP_HOSTNAME_ALWAYS=${LP_HOSTNAME_ALWAYS:-0}
LP_PS1=${LP_PS1:-""}
LP_BATTERY_MARK=${LP_BATTERY_MARK:-"⌁"}
LP_ADAPTER_MARK=${LP_ADAPTER_MARK:-"⏚"}
LP_LOAD_MARK=${LP_LOAD_MARK:-"⌂"}
LP_PROXY_MARK=${LP_PROXY_MARK:-"↥"}
LP_MERCURIAL_MARK=${LP_MERCURIAL_MARK:-"☿"}
LP_SUBVERSION_MARK=${LP_SUBVERSION_MARK:-"‡"}
LP_GIT_MARK=${LP_GIT_MARK:-"±"}
LP_MARK_BATTERY=${LP_MARK_BATTERY:-"⌁"}
LP_MARK_ADAPTER=${LP_MARK_ADAPTER:-"⏚"}
LP_MARK_LOAD=${LP_MARK_LOAD:-"⌂"}
LP_MARK_PROXY=${LP_MARK_PROXY:-"↥"}
LP_MARK_HG=${LP_MARK_HG:-"☿"}
LP_MARK_SVN=${LP_MARK_SVN:-"‡"}
LP_MARK_GIT=${LP_MARK_GIT:-"±"}
LP_UNTRACKED=${LP_UNTRACKED:-"*"}
LP_ENABLE_GIT=${LP_ENABLE_GIT:-1}
@ -824,7 +824,7 @@ _lp_load_color()
if [[ $load -ge $LP_LOAD_THRESHOLD ]]
then
local ret
ret="${LP_LOAD_MARK}${NO_COL}"
ret="${LP_MARK_LOAD}${NO_COL}"
if [[ $load -ge 0 ]] && [[ $load -lt 20 ]] ; then
ret="${ret}${LP_COLORMAP_0}"
elif [[ $load -ge 20 ]] && [[ $load -lt 40 ]] ; then
@ -880,9 +880,9 @@ _lp_smart_mark()
if [[ ! -z $(_lp_git_branch) ]] ; then
mark=$LP_GIT_MARK
elif [[ ! -z $(_lp_hg_branch) ]] ; then
mark=$LP_MERCURIAL_MARK
mark=$LP_HG_MARK
elif [[ ! -z $(_lp_svn_branch) ]] ; then
mark=$LP_SUBVERSION_MARK
mark=$LP_SVN_MARK
fi
echo -ne "${COL}${mark}${NO_COL}"
}