Browse Source

included git-prompt

master
root 5 years ago
parent
commit
4517cbe488
  1. 9
      featuredPS1.sh

9
featuredPS1.sh

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
## (c) by wiebel (wiebel42@gmail.com) ## (c) by wiebel (wiebel42@gmail.com)
# Function to display the returncode of the previous command if not zero # Function to display the returncode of the previous command if not zero
source /usr/share/git/git-prompt.sh
ps1_return() { ps1_return() {
if [ "$1" != "0" ]; then if [ "$1" != "0" ]; then
echo -e "$1 " echo -e "$1 "
@ -190,7 +192,8 @@ else
PS1P='\[$(ps1_write)\]\$ \[\033[0m\]' PS1P='\[$(ps1_write)\]\$ \[\033[0m\]'
PS1ret='\[\033[01;31m\]$(ps1_return $?)' PS1ret='\[\033[01;31m\]$(ps1_return $?)'
PS1dir='\[$(ps1_pre_color)\]$(ps1_pre)\[$(ps1_dir_color)\]$(ps1_dir $(ps1_pre))' PS1dir='\[$(ps1_pre_color)\]$(ps1_pre)\[$(ps1_dir_color)\]$(ps1_dir $(ps1_pre))'
export PS1="${PS1pre}${PS1U}${PS1H} ${PS1dir} ${PS1ret}${PS1P}" PS1git='$(__git_ps1 " (%s)")'
export PS1="${PS1pre}${PS1U}${PS1H} ${PS1dir}${ON_COLOR}${PS1git} ${PS1ret}${PS1P}"
fi fi
fi fi
@ -200,5 +203,5 @@ ROOT_SYM="\033[00;36m"
HOME_SYM="\033[00;33m" HOME_SYM="\033[00;33m"
SYM_COLOR="\033[00;36m" # cyan SYM_COLOR="\033[00;36m" # cyan
ON_COLOR="\033[01;37m" # white ON_COLOR="\033[01;97m" # white
OFF_COLOR="\033[01;30m" # grey OFF_COLOR="\033[01;37m" # grey

Loading…
Cancel
Save