-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.bashrc
132 lines (108 loc) · 3.83 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Check the size of window at each command and resize when necessary.
shopt -s checkwinsize
# Causes bash to append to history instead of overwriting it so if you start a new terminal, you have old session history
shopt -s histappend
PROMPT_COMMAND="my_ps1; history -n; history -w; history -c; history -r;"
#Avoid duplicate entries in history
export HISTCONTROL=ignoreboth:erasedups
# My personality PS1 variable
function my_ps1(){
local EXIT="$?" # This needs to be first
PS1=""
local red='\[\e[0;31m\]'
local gre='\[\033[38;5;10m\]'
local whi='\[\e[0;37m\]'
local blu='\[\e[1;34m\]'
if [ $EXIT != 0 ]; then
local exit_status="[${red}$EXIT${whi}]"
else
local exit_status="[${gre}$EXIT${whi}]"
fi
local user_and_host="${whi}[${gre}\u@\h${whi}]"
local current_path="${blu}\w"
if [[ ${USER} == "root" ]]; then
local final_simbol="${red}#" # User is root.
elif [[ ${USER} != $(logname) ]]; then
local final_simbol="${blu}\$" # User is not login user.
else
local final_simbol="${whi}\$" # User is normal (well ... most of us are).
fi
local break_line='\n'
export PS1+="${exit_status}${user_and_host}${current_path}${break_line}${final_simbol}${whi} "
}
# Ignore case on auto-completion
if [[ $iatest > 0 ]]; then bind "set completion-ignore-case on"; fi
#----------------ALIAS----------------#
alias bd='cd "$OLDPWD"'
alias htop='sudo htop'
alias minidlnad='minidlnad -R'
alias go_unb='cd /home/wilton/Dropbox/UnB'
alias workspace='cd /home/wilton/Workspace'
alias gpu-is-on='cat /proc/acpi/bbswitch'
alias ls='ls --color=auto'
alias la='ls -Alh'
alias fixsteam1='find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete'
alias fixsteam2='find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" \) -print -delete'
alias fixsteam3='find ~/.steam/root/ -name "libgpg-error.so*" -print -delete'
alias openports='netstat -nape --inet'
alias reboot="sudo systemctl reboot"
alias poweroff="sudo systemctl poweroff"
alias suspend="sudo systemctl suspend"
alias turnoff-monitor="xset -display :0.0 dpms force off"
alias op="xdg-open"
alias gs="git status"
alias gb="git branch"
alias gc="git commit"
alias gd="git diff"
alias ga="git add"
alias gl="git log"
alias gr="git remote -v"
#Setting to not be disturbed by Ctrl-S ctrl-Q in terminals
stty -ixon
#Setting de defaults app
BROWSER=/usr/bin/google-chrome-stable
EDITOR=vim
#Setting more line to history commands
HISTSIZE=500000
HISTFILESIZE=500000
#Set partial history search with up key
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
#Set the rvm path
export PATH="$PATH:$HOME/.rvm/bin"
#Set the android path
export ANDROID_HOME="/opt/android-sdk"
# Add RVM to PATH for scripting
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
export ANDROID_HOME=/opt/android-sdk
#Set the pyenv paths.
#export PYENV_ROOT="$HOME/.pyenv"
#export PATH="$PYENV_ROOT/bin:$PATH"
#eval "$(pyenv init -)"
# Color for manpages in less makes manpages a little easier to read
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
export EDITOR=vim
if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec startx
fi
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi