2013-06-01 23:09:59 +00:00
|
|
|
#####POUR PAS S'ECRIRE DESSUS
|
|
|
|
shopt -s checkwinsize
|
|
|
|
|
2013-06-11 20:39:53 +00:00
|
|
|
#Launch startx when login
|
|
|
|
[[ -z $DISPLAY && $XDG_VTNR -le 4 ]] && exec startx
|
|
|
|
|
2013-06-02 11:02:37 +00:00
|
|
|
shopt -s histappend
|
|
|
|
PROMPT_COMMAND='history -a'
|
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
#set -o vi
|
|
|
|
export EDITOR="vim"
|
|
|
|
#####ON DEFINIT LES COULEURS
|
|
|
|
red='\033[31m'
|
|
|
|
RED='\033[31m\033[01m'
|
|
|
|
blue='\033[34m'
|
|
|
|
BLUE='\033[34m'
|
|
|
|
cyan='\033[36m'
|
|
|
|
CYAN='\033[36m'
|
|
|
|
magenta='\033[35m'
|
|
|
|
DFT='\033[0m'
|
|
|
|
white='\033[37m'
|
|
|
|
#####ON DEFINIT LE TITRE DE LA FENETRE PAR LE REP EN COURS
|
|
|
|
case "$TERM" in
|
|
|
|
xterm*|rxvt*)
|
|
|
|
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
#####ON MET LA COULEUR POUR ls
|
|
|
|
if [ "$TERM" != "dumb" ]; then
|
|
|
|
eval "`dircolors -b`"
|
|
|
|
alias ls='ls --color=auto'
|
|
|
|
fi
|
|
|
|
|
|
|
|
#####LA COULEUR DU SHELL
|
|
|
|
#PS1="$RED\u$DFT$white@$magenta\h $DFT>>$CYAN\w $DFT"
|
|
|
|
#PS1="\u@\h >>\w "
|
|
|
|
#PS1="\[$RED\u$DFT$white@$magenta\h $DFT>>$CYAN\w $DFT\]"
|
|
|
|
#PS1="\[$RED\]\u\[$DFT$white\]@\[$magenta\]\h \[$DFT\]>>\[$CYAN\]\w \[$DFT\]"
|
|
|
|
#PROMPT_COMMAND='history -a;echo -en "\033[m\033[38;5;2m"$(( `sed -nu "s/MemFree:[\t ]\+\([0-9]\+\) kB/\1/p" /proc/meminfo`/1024))"\033[38;5;22m/"$((`sed -nu "s/MemTotal:[\t ]\+\([0-9]\+\) kB/\1/Ip" /proc/meminfo`/1024 ))MB"\t\033[m\033[38;5;55m$(< /proc/loadavg)\033[m"'
|
|
|
|
PS1='\[\e[0;36m\] \T \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]\[\e[0;32m\]\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n$ '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#####LES ALIAS UTILES
|
|
|
|
alias ..='cd ..'
|
2013-06-04 16:43:31 +00:00
|
|
|
alias vf='cd'
|
|
|
|
alias xs='cd'
|
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias rm='rm -i'
|
|
|
|
alias cp='cp -i'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias mv='mv -i'
|
|
|
|
alias vm='mv -i'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
|
|
|
alias df='dfc'
|
|
|
|
alias free='freec'
|
2013-06-01 23:09:59 +00:00
|
|
|
alias shred='shred -n 35 -z -u -v -f'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias sl='ls'
|
|
|
|
alias la='ls -lah'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
|
|
|
|
alias sudp='sudo' #fuck tpyos :p
|
|
|
|
alias sudpo='sudo'
|
|
|
|
|
|
|
|
#alias pacman='pacman-color'
|
|
|
|
alias pacmacn='pacman'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias grep='grep --color'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias b+='xbacklight -inc 10%'
|
|
|
|
alias b-='xbacklight -dec 10%'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias svim='sudo vim'
|
|
|
|
alias bim='vim'
|
|
|
|
alias vi='vim'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias gl='git log --graph --abbrev-commit --pretty=oneline --decorate'
|
|
|
|
alias gitst='git status'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
alias poule='git pull'
|
|
|
|
alias makew='make'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
|
|
|
alias BSI2='cd ~/Documents/UniGE/BSI2*/'
|
2013-06-04 16:56:56 +00:00
|
|
|
|
2013-06-11 21:26:08 +00:00
|
|
|
OCTOPUS=~/Programmation/Utils/octopus.sh
|
|
|
|
alias dual='$OCTOPUS monitor dual'
|
|
|
|
alias laptop='$OCTOPUS monitor laptop'
|
|
|
|
alias extern='$OCTOPUS monitor extern'
|
|
|
|
|
|
|
|
alias volup='$OCTOPUS volume up'
|
|
|
|
alias voldown='$OCTOPUS volume down'
|
|
|
|
alias volmute='$OCTOPUS volume mute'
|
|
|
|
|
|
|
|
|
|
|
|
#MONITOR_PATH=~/Programmation/Utils/monitor.sh
|
|
|
|
#alias dual='$MONITOR_PATH dual'
|
|
|
|
#alias laptop='$MONITOR_PATH laptop'
|
|
|
|
#alias extern='$MONITOR_PATH extern'
|
2013-06-04 16:43:31 +00:00
|
|
|
|
2013-06-01 23:09:59 +00:00
|
|
|
#alias 'make celan'='make clean'
|
|
|
|
|
|
|
|
export PYTHONPATH=/usr/local/lib/python2.7/dist-packages
|
|
|
|
export CC=clang
|
|
|
|
|
|
|
|
|
|
|
|
export DEVKITPRO=/opt/devkitpro
|
|
|
|
export DEVKITARM=$DEVKITPRO/devkitARM
|
|
|
|
export PATH=$PATH:$DEVKITARM/bin
|
|
|
|
export MANPATH=$MANPATH:$DEVKITARM/man
|
|
|
|
|
|
|
|
|
|
|
|
function cd()
|
|
|
|
{
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
builtin cd ~ && ls
|
|
|
|
else
|
|
|
|
builtin cd "$*" && ls
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function logs {
|
|
|
|
tail -f $1 | ccze -A
|
|
|
|
}
|
|
|
|
|
|
|
|
function mkcd() {
|
|
|
|
mkdir -p "$@"
|
|
|
|
cd "$@"
|
|
|
|
}
|
2013-06-02 11:02:37 +00:00
|
|
|
|
|
|
|
extract() {
|
|
|
|
local e=0 i c
|
|
|
|
for i; do
|
|
|
|
if [ -f $i && -r $i ]; then
|
|
|
|
c=
|
|
|
|
case $i in
|
|
|
|
*.tar.bz2) c='tar xjf' ;;
|
|
|
|
*.tar.gz) c='tar xzf' ;;
|
|
|
|
*.bz2) c='bunzip2' ;;
|
|
|
|
*.gz) c='gunzip' ;;
|
|
|
|
*.tar) c='tar xf' ;;
|
|
|
|
*.tbz2) c='tar xjf' ;;
|
|
|
|
*.tgz) c='tar xzf' ;;
|
|
|
|
*.7z) c='7z x' ;;
|
|
|
|
*.Z) c='uncompress' ;;
|
|
|
|
*.exe) c='cabextract' ;;
|
|
|
|
*.rar) c='unrar x' ;;
|
|
|
|
*.xz) c='unxz' ;;
|
|
|
|
*.zip) c='unzip' ;;
|
|
|
|
*) echo "$0: cannot extract \`$i': Unrecognized file extension" >&2; e=1 ;;
|
|
|
|
esac
|
|
|
|
[ $c ] && command $c "$i"
|
|
|
|
else
|
|
|
|
echo "$0: cannot extract \`$i': File is unreadable" >&2; e=2
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
return $e
|
|
|
|
}
|