-
Notifications
You must be signed in to change notification settings - Fork 3
/
bashrc_tradr_add
62 lines (44 loc) · 1.62 KB
/
bashrc_tradr_add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#================================================
# Additional settings
# NOTE: the CONTAINER_NAME env var is set from the used Dockerfile
if [ ! -f /tmp/execWorks ]; then
touch /tmp/execWorks
# personalize the new command line for the main docker launch
export PS1="\[\033[32m\][main_$CONTAINER_NAME]\[\033[00m\]$PS1"
else
# personalize the new command line
export PS1="\[\033[34m\][$CONTAINER_NAME]\[\033[00m\]$PS1"
fi
# TRADR stuff
export TRADR_HOME='~/Work/tradr_wss'
eval TRADR_HOME=$TRADR_HOME
alias tradr-cd='cd $TRADR_HOME'
alias tradr-source='source $TRADR_HOME/source-all.bash'
# VREP settings
export VREP_ROOT_DIR=/usr/local/V-REP_PRO_EDU_V3_2_2_64_Linux
# ROS: source indigo
source /opt/ros/$ROS_DISTRO/setup.bash
export EDITOR='geany' # for rosed
# ROS: set automatically ROS_IP
#export ROS_IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
export ROS_IP_=`hostname -I | head -n1 | awk '{print $1}'`
if [ "$ROS_IP_" != "" ]; then
export ROS_IP="$ROS_IP_"
fi
# TRADR: auto source of tradr_ws
#source $TRADR_HOME/source-all.sh
#rosparam set use_sim_time true
export LC_NUMERIC=C # for gazebo
if [ "$ROS_IP_" != "" ]; then
export TRADR_CORE="$ROS_IP_"
else
export TRADR_CORE=$HOSTNAME
fi
# from https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
#export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
PS_new=${PS1::-3} # remove the final ' $'
export PS1="$PS_new\[\033[32m\]\$(parse_git_branch)\[\033[00m\]$ "