#
# - Configured - #
# vim ~/.bashrc;
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Add nano as default editor

export EDITOR=vim
export PULSE_LATENCY_MSEC=60

[ ! "$UID" = "0" ] && archbluey -c white
[  "$UID" = "0" ] && archbluey -c blue

PS1="\[\e[01;31m\]┌─[\[\e[01;35m\u\e[01;31m\]]──[\[\e[00;37m\]${HOSTNAME%%.*}\[\e[01;32m\]]:\w$\[\e[01;31m\]\n\[\e[01;31m\]└──\[\e[01;36m\]>> \[\e[0m\]"

# Add colors for filetype and  human-readable sizes by default on ls:

alias ls='ls --color=auto'
alias lx='ls -lXBh'             #  Sort by extension.
alias lk='ls -lSrh'             #  Sort by size, biggest last.
alias lt='ls -ltrh'             #  Sort by date, most recent last.
alias lc='ls -ltcrh'            #  Sort by/show change time,most recent last.
alias lu='ls -lturh'            #  Sort by/show access time,most recent last.
alias ld='ls -ldh */'           #  Only folders
alias lf="ls -alh | grep '^-'"  #  Only files

# The ubiquitous 'll': directories first, with alphanumeric sorting:

alias l='ls -CFh'
alias ll='ls -lvhF --group-directories-first'
alias lm='ll |more'        #  Pipe through more
alias lr='ll -Rh'           #  Recursive ls.
alias lA='ls -Ah'           #  Show hidden files.
alias la='ls -lahvF'
alias lsa='ls -ah'
alias alF='ls -alFh'
alias lhA='ls -lhA'
alias Alh='ls -Alh --group-directories-first --color=auto --'

alias tree='tree -Csuh'    #  Nice alternative to recursive ls ...

# some commands aliases corrections.

alias cd..='cd ..'         #  This one will change to your parent directory, even when you forget the space.
alias ..='cd ..'           #  You can also cut out the cd part entirely by making an alias for ..
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
alias .......='cd ../../../../../../'

#alias uSH='ssh www.isdevelopment.us' 
alias uS30='ssh 10.0.0.30'
alias plex='ssh 10.0.0.6'
alias sshP='ssh root@10.0.0.50'
alias uSH='ssh 10.0.0.100'
alias uSP='ssh 10.0.0.200'
alias sshM='ssh 10.0.0.250'
alias sshL='ssh root@192.168.1.10'


#  This one will list our disk usage in human-readable units including filesystem type, and print a total at the bottom
alias df='df -Tha --total'

#  We might as well add an alias for our preferred du output as well:
alias du='du -ach | sort -h'

#  Let's keep going in the same direction by making our free output more human friendly:
alias free='free -mt'

#  We can do a lot with our listing process table. Let's start out by setting a default output:
alias ps='ps auxf'

#  We might want to add a -v flag on top of that so we are told of every directory creation, 
#  which can help us recognize quickly if we had a typo which caused an accidental directory branch:
alias mkdir='mkdir -pv'
alias md='mkdir';
alias rm='rm -r';
alias cls='clear';
alias lb='lsblk -f;';
alias fs='cat /etc/fstab;';
alias efs='sudo vim /etc/fstab;';
alias ssn='sudo shutdown now';
alias srn='sudo reboot now';
alias ipa='ip -c address;';
alias ping='ping -c 3';
alias sp='sudo pacman -S ';

alias update='sudo pacman -Syu --noconfirm && sudo pacman -Syyuu --noconfirm;'

cls;
if [ "$USER" == "root" ]; then cd ~/; fi;
screenfetch;

IPa=$(echo $(echo $(ifconfig 2>/dev/null | grep '10.0.0.')) | awk '{print $2;}');
if [ "$IPa" == "" ]; then
   IPa=$(echo $(echo $(ifconfig 2>/dev/null | grep '192.168.')) | awk '{print $2;}'); fi;
if [ "$IPa" == "" ]; then
   IPa=$(echo $(echo $(ip a 2>/dev/null | grep '10.0.0.')) | awk '{print $2;}'); fi;
if [ "$IPa" == "" ]; then
   IPa=$(echo $(echo $(ip a 2>/dev/null | grep '192.168.')) | awk '{print $2;}'); fi;


echo '';
echo "Local ip address:" $IPa;



