Python venv added to .bashrc.
This commit is contained in:
@@ -121,8 +121,8 @@ if [ -n "$PS1" ]; then
|
|||||||
c_cwd="$(tput setaf 99)"
|
c_cwd="$(tput setaf 99)"
|
||||||
c_time="$(tput setaf 33)" #Light blue
|
c_time="$(tput setaf 33)" #Light blue
|
||||||
c_branch="$(tput setaf 138)"
|
c_branch="$(tput setaf 138)"
|
||||||
c_exit="$(tput setaf 203)" #Red
|
c_error="$(tput setaf 203)" #Red
|
||||||
c_jobs="$(tput setaf 220)" #Yellow
|
c_info="$(tput setaf 220)" #Yellow
|
||||||
else
|
else
|
||||||
c_reset="$(tput sgr0)"
|
c_reset="$(tput sgr0)"
|
||||||
c_user="$(tput setaf 1)" #
|
c_user="$(tput setaf 1)" #
|
||||||
@@ -130,8 +130,8 @@ if [ -n "$PS1" ]; then
|
|||||||
c_cwd="$(tput setaf 7)" #White
|
c_cwd="$(tput setaf 7)" #White
|
||||||
c_time="$(tput setaf 6)" #Cyan
|
c_time="$(tput setaf 6)" #Cyan
|
||||||
c_branch="$(tput setaf 6)" #Cyan
|
c_branch="$(tput setaf 6)" #Cyan
|
||||||
c_exit="$(tput setaf 1)" #Red
|
c_error="$(tput setaf 1)" #Red
|
||||||
c_jobs="$(tput setaf 3)" #Yellow
|
c_info="$(tput setaf 3)" #Yellow
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$(which svn)" ] && prompt_check_svn=true
|
[ -n "$(which svn)" ] && prompt_check_svn=true
|
||||||
@@ -177,21 +177,29 @@ if [ -n "$PS1" ]; then
|
|||||||
# exit code if not zero
|
# exit code if not zero
|
||||||
#
|
#
|
||||||
if [ "$exit_code" -ne "0" ]; then
|
if [ "$exit_code" -ne "0" ]; then
|
||||||
PS1+=",\[$c_exit\]rc=$exit_code"
|
PS1+=",\[$c_error\]rc=$exit_code"
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
# Python venv.
|
||||||
|
#
|
||||||
|
local jobs_bg=$(jobs -r | wc -l | tr -d ' ')
|
||||||
|
if [ -n "$VIRTUAL_ENV" ]; then
|
||||||
|
# PS1+=",\[$c_info\]$(realpath --relative-to=$PWD $VIRTUAL_ENV)"
|
||||||
|
PS1+=",\[$c_info\]$(basename $VIRTUAL_ENV)"
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# Info about jobs.
|
# Info about jobs.
|
||||||
#
|
#
|
||||||
local jobs_bg=$(jobs -r | wc -l | tr -d ' ')
|
local jobs_bg=$(jobs -r | wc -l | tr -d ' ')
|
||||||
if [ $jobs_bg -gt 0 ]; then
|
if [ $jobs_bg -gt 0 ]; then
|
||||||
PS1+=",\[$c_jobs\]bg=$jobs_bg"
|
PS1+=",\[$c_info\]bg=$jobs_bg"
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# Info about jobs.
|
# Info about jobs.
|
||||||
#
|
#
|
||||||
local jobs_stopped=$(jobs -s | wc -l | tr -d ' ')
|
local jobs_stopped=$(jobs -s | wc -l | tr -d ' ')
|
||||||
if [ $jobs_stopped -gt 0 ]; then
|
if [ $jobs_stopped -gt 0 ]; then
|
||||||
PS1+=",\[$c_jobs\]stp=$jobs_stopped"
|
PS1+=",\[$c_info\]stp=$jobs_stopped"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user