2012-08-14 09:38:33 -04:00
|
|
|
|
|
|
|
#######################################
|
|
|
|
# LIQUID PROMPT DEFAULT TEMPLATE FILE #
|
|
|
|
#######################################
|
|
|
|
|
|
|
|
# Available features:
|
|
|
|
# LP_BATT battery
|
|
|
|
# LP_LOAD load
|
|
|
|
# LP_JOBS screen sessions/running jobs/suspended jobs
|
|
|
|
# LP_USER user
|
|
|
|
# LP_HOST hostname
|
|
|
|
# LP_PERM a colon ":"
|
|
|
|
# LP_PWD current working directory
|
|
|
|
# LP_PROXY HTTP proxy
|
2013-01-23 12:17:24 -05:00
|
|
|
# LP_VCS the content of the current repository
|
2012-08-14 09:38:33 -04:00
|
|
|
# LP_ERR last error code
|
|
|
|
# LP_MARK prompt mark
|
2012-08-17 10:31:45 -04:00
|
|
|
# LP_TIME current time
|
2013-01-10 11:18:45 -05:00
|
|
|
# LP_PS1_PREFIX user-defined general-purpose prefix (default set a generic prompt as the window title)
|
2012-08-14 09:38:33 -04:00
|
|
|
|
2012-08-16 06:13:40 -04:00
|
|
|
# Remember that most features come with their corresponding colors,
|
|
|
|
# see the README.
|
|
|
|
|
2013-01-04 08:08:26 -05:00
|
|
|
# add time, jobs, load and battery
|
|
|
|
LP_PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_JOBS}"
|
2012-08-14 09:38:33 -04:00
|
|
|
# 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
|
2013-01-04 08:08:26 -05:00
|
|
|
LP_PS1="${LP_PS1}${LP_PWD}]${LP_VENV}${LP_PROXY}"
|
2012-08-14 09:38:33 -04:00
|
|
|
# add VCS infos
|
2013-01-23 12:17:24 -05:00
|
|
|
LP_PS1="${LP_PS1}${LP_VCS}"
|
2012-08-14 09:38:33 -04:00
|
|
|
else
|
|
|
|
# path in yellow
|
2013-01-04 08:08:26 -05:00
|
|
|
LP_PS1="${LP_PS1}${LP_PWD}]${LP_VENV}${LP_PROXY}"
|
|
|
|
# do not add VCS infos unless told otherwise (LP_ENABLE_VCS_ROOT)
|
2013-01-23 12:17:24 -05:00
|
|
|
[[ "$LP_ENABLE_VCS_ROOT" = "1" ]] && LP_PS1="${LP_PS1}${LP_VCS}"
|
2012-08-14 09:38:33 -04:00
|
|
|
fi
|
|
|
|
# add return code and prompt mark
|
2012-08-16 06:13:40 -04:00
|
|
|
LP_PS1="${LP_PS1}${LP_ERR}${LP_MARK}"
|
2012-08-14 09:38:33 -04:00
|
|
|
|
2013-01-10 11:18:45 -05:00
|
|
|
# "invisible" parts
|
|
|
|
# Get the current prompt on the fly and make it a title
|
|
|
|
LP_TITLE=$(_lp_title $PS1)
|
|
|
|
|
|
|
|
# Insert it in the prompt
|
|
|
|
PS1="${LP_TITLE}${PS1}"
|
|
|
|
|
2012-08-14 09:59:36 -04:00
|
|
|
# vim: set et sts=4 sw=4 tw=120 ft=sh:
|