~ joephantom /.bashrc

extract () {
#
    if [ -f $1 ] ; then
#
        case $1 in
#
            *.tar.bz2)  tar xjf $1      ;;
#
            *.tar.gz)   tar xzf $1      ;;
#
            *.bz2)      bunzip2 $1      ;;
#
            *.rar)      unrar x $1      ;;
#
            *.gz)       gunzip $1       ;;
#
            *.tar)      tar xf $1       ;;
#
            *.tbz2)     tar xjf $1      ;;
#
            *.tgz)      tar xzf $1      ;;
#
            *.zip)      unzip $1        ;;
#
            *.Z)        uncompress $1   ;;
#
            *)          echo "'$1' cannot be extracted via extract()" ;;
#
        esac
#
    else
#
        echo "'$1' is not a valid file"
#
    fi
#
}
#
 
#
rmspaces() {
#
    ls | while read -r FILE
#
        do
#
        mv -v "$FILE" `echo $FILE | tr ' ' '_' | tr -d '[{}(),\!]' | tr -d "\'" | tr '[A-Z]' '[a-z]' | sed 's/_-_/_/g'`
#
        done
#
}
#
makepasswords() {
#
    perl <<EOPERL
#
        my @a = ("a".."z","A".."Z","0".."9",(split //, q{#@,.<>$%&()*^}));
#
        for (1..10) {
#
            print join "", map { \$a[rand @a] } (1..rand(3)+10);
#
            print qq{\n}
#
        }
#
EOPERL
#
}
#
 
#
alias ls='ls --color=auto'
#
#PS1="\[\e[36;1m\]\u @ \[\e[32;1m\]\H > \[\e[0m\]"
#
PS1='\[\033[0;36m\]\033(0l\033(B\[\033[0m\][\[\033[1;31m\]\u\[\033[0m\]]\[\033[0;36m\]\033(0q\033(B\[\033[0m\][\[\033[1;33m\]@\h\[\033[0m\]]\[\033[0;36m\]\033(0q\033(B\[\033[0m\][\[\033[0;37m\]\T\[\033[0m\]]\[\033[0;36m\]\033(0q\033(B\033(0q\033(B\033(0q\033(B\033(0q\033(B\033(0q\033(B\033(0q\033(B\033(0q\033(B\033(0q\033(B\[\033[0m\][\[\033[1;33m\]\w\[\033[0m\]]\n\[\033[0;36m\]\033(0m\033(B\[\033[0m\]>'
#
complete -cf sudo

alias pacs="pacsearch"
pacsearch () {
       echo -e "$(pacman -Ss $@ | sed \
       -e 's#core/.*#\\033[1;31m&\\033[0;37m#g' \
       -e 's#extra/.*#\\033[0;32m&\\033[0;37m#g' \
       -e 's#community/.*#\\033[1;35m&\\033[0;37m#g' \
       -e 's#^.*/.* [0-9].*#\\033[0;36m&\\033[0;37m#g' )"
}