Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define colors
- red="\[\033[0;38;5;1m\]"
- green="\[\033[0;38;5;2m\]"
- nocolor='\e[0m'
- #promptcolor=$green
- function pre_prompt {
- if (echo $PWD |grep -q $HOME);then
- promptcolor=$green
- #echo "Home" #debug
- else
- promptcolor=$red
- #echo "Away" #debug
- fi
- }
- PROMPT_COMMAND=pre_prompt
- PS1="$promptcolor( $debugtxt ) $nocolor$ "
Advertisement
Add Comment
Please, Sign In to add comment