# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything:
[ -z "$PS1" ] && return

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# History settings - see bash(1) for more options
export HISTCONTROL=ignoreboth # duplicate lines or lines starting with space
export HISTSIZE=-1
export HISTFILESIZE=-1
shopt -s histappend # append to history file, don't overwrite

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

# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
    eval "$(dircolors -b)"
    alias ls='ls --color=auto'
fi

# 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

# Set up a color prompt
if [ "$SHLVL" -gt 1 ]; then
    PS1='[$SHLVL] ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
fi

# If this is an xterm set the title to user@host:dir
# and set the term type to plain xterm
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
    export TERM="xterm"
    ;;
*)
    ;;
esac

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


## My own part is down here...

# User info output
echo "X display is set to ${DISPLAY}"
echo "$(hostname -f) has $(grep processor /proc/cpuinfo |wc -l) cores" \
    "with architecture $(uname -m)" \
    "and $(gawk '/MemTotal/ { printf "%0.1f",$2/1024/1024 }' /proc/meminfo) GB RAM."
echo "GCC installed: $(gcc -dumpversion)"
