# ~/.bashrc: executed by bash(1) for non-login shells.

#export PS1='\h:\w\$ '
umask 022

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups

# Éditeur par défaut
export EDITOR=vim

# Pager supportant la couleur
export PAGER=most

# Pour les contributions à Debian
export DEBEMAIL="lkppo@free.fr"
export DEBFULLNAME="Stéphane Aulery"

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
        debian_chroot=$(cat /etc/debian_chroot)
fi

# Mémorise le numéro du terminal
numtty=$(temp=$(tty); echo ${temp:5});

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|xterm*|rxvt*)
        PS1='\[\033[01;33m\]$numtty\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$'
        ;;
*)
        PS1='$numtty:\w\$'
        ;;
esac

# Colorise les sorties de eval, ls, et grep si le terminal l'accepte
if [ "$TERM" != "dumb" ]; then
        eval "`dircolors -b`"
        alias ls='ls --color=auto'
        alias dir='ls --color=auto --format=vertical'
        alias vdir='ls --color=auto -l -h --time-style=long-iso'
        alias grep='grep --color=auto'
        alias egrep='egrep --color=auto'
fi

# Affichage des tailles avec des unités en octets
alias du='du -h'
alias df='df -h'

# Afficher les PDF en console avec la couleur et la résolution maximale
alias fbgs='fbgs -c -xxl'

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
        . /etc/bash_completion
fi

# Some more alias to avoid making mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

alias mutt='mutt -y'

alias mute='xset b off'

# Sauvegarde le fichier journal du noyau au démarrage
DMESG_NAME=$(uname -r)
dmesg > "/tmp/3dmesg-$DMESG_NAME"

# Préconfiguration de paps pour l'impression de fichiers plain text
alias paps96='paps --header --font=9'
alias paps86='paps --header --font=10'
alias paps78='paps --header --font=11'
alias paps71='paps --header --font=12'
