-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbashrc
92 lines (77 loc) · 2.26 KB
/
bashrc
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# ~/.bashrc
#
function source_if_exists() {
[[ -f "$1" ]] && source "$1"
}
# firstly, source .bashrc provided by vendor
source_if_exists "$HOME/.bashrc.backup"
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# PS1='[\u@\h \W]\$ '
PS1='${arch_chroot:+($arch_chroot)}\[\033[01;33m\]\u\[\033[01;30m\]@\h\[\033[37m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# In yaourt, we can edit stuff with vim
export VISUAL=vim
# functions manipulates build flags
COMFLAGS="-Wall -g -O0"
function flags_clear() {
export CFLAGS=""
export CXXFLAGS=""
export CC=""
export CXX=""
}
function flags_gcc() {
export CFLAGS="$COMFLAGS -std=c17"
export CXXFLAGS="$COMFLAGS -std=c++17"
export CC="gcc"
export CXX="g++"
}
function flags_clang() {
export CFLAGS="$COMFLAGS -std=c17"
export CXXFLAGS="$COMFLAGS -std=c++17"
export CC="clang"
export CXX="clang++"
}
# Some useful alias
alias ag='ag --follow'
alias ll='ls --color=auto -alh'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
#alias tree='tree -C' # -C enforce colorization on pipe
HOST="127.0.0.1"
SOCKS5_PORT=10808
HTTP_PORT=10809
alias proxy="ALL_PROXY=socks5://$HOST:$SOCKS5_PORT/ \
http_proxy=http://$HOST:$HTTP_PORT/ \
https_proxy=http://$HOST:$HTTP_PORT/ \
HTTP_PROXY=http://$HOST:$HTTP_PORT/ \
HTTPS_PROXY=http://$HOST:$HTTP_PORT/ \
JAVA_OPTIONS=\"-DsocksProxyHost=$HOST -DsocksProxyPort=$SOCKS5_PORT\""
unset HOST
unset SOCKS5_PORT
unset HTTP_PORT
function check_command() {
command -v "$1" >/dev/null 2>&1
}
# bash completion for stack
check_command "stack" && eval "$(stack --bash-completion-script stack)"
# thefuck
check_command "thefuck" && eval $(thefuck --alias)
# ROS
check_command "catkin_make" && {
source "/opt/ros/melodic/setup.bash"
source "$HOME/catkin_ws/devel/setup.bash"
# see https://wiki.ros.org/ROS/EnvironmentVariables#ROS_PARALLEL_JOBS
export ROS_PARALLEL_JOBS="-j4 -l4"
# actual uri & ip set in .bachrc_not_synced
export ROS_MASTER_URI=http://255.255.255.255:11311
export ROS_IP=255.255.255.255
}
# Gazebo
check_command "gzserver" && {
source "/usr/share/gazebo/setup.sh"
export GAZEBO_MODEL_DATABASE_URI=http://models.gazebosim.org
export GAZEBO_MODEL_PATH="$HOME/Documents/gazebo-9/models"
}
# include platform specific bashrcs
source_if_exists "$HOME/.bashrc_local"