Bashrc

From Attie's Wiki
Revision as of 10:08, 28 October 2014 by Attie (Talk | contribs)

Jump to: navigation, search

Below is the extended contents of my ~/.bashrc_mine file (include it from ~/.bashrc)

if [ "$ATTIE_PATH" == "" ]; then
  export PATH=~/.bin:$PATH
  export ATTIE_PATH=done
fi
 
if [ -x /usr/bin/screen ]; then
  if [ "$STY" ]; then
    alias is='echo yes'
    alias exit='screen -d $STY'
    alias qs='kill `echo $STY|cut -d "." -f 1`'
  else
    alias is='echo no'
    alias us='screen -d -R uni'
    alias ss='screen -S `date "+screen_%d-%b-%Y_%k:%M.%S"`'
    alias sl='screen -list'
    alias sc='screen -d -R'
  fi
else
  echo "WARNING: /usr/bin/screen was not found. screen aliases not inserted..."
fi
 
export EDITOR="vim"
 
if [ "$TERM" != "xterm" ]; then
  return
fi
 
######################
### the prompt bit ###
#: 'host cwd'
PS1_TITLE="\e]0;\h \w\007\]"
#: 'hh:mm:ss'
PS1_TIME="\e[0;33m\]\T\e[0m"
#: 'user@host:cwd [jobs]'
PS1_INFO="\e[32m\]\u\e[90m\]@\e[35m\]\h\e[90m\]:\e[36m\[\w\e[0m\] [\j]"
#: trademark hashes
if [ "$(whoami)" == "root" ]; then
  PS1_HASHSTART="\e[0m\]#\e[91m\]#\e[31m\]#\e[0m "
  PS1_HASHEND=" \e[31m\]#\e[91m\]#\e[0m\]#\e[0m"
else
  PS1_HASHSTART="\e[0m\]#\e[94m\]#\e[34m\]#\e[0m "
  PS1_HASHEND=" \e[34m\]#\e[94m\]#\e[0m\]#\e[0m"
fi
#: '$ '
if [ "${PS1_PROMPT}" == "" ]; then
  PS1_PROMPT="$ "
fi
#: '$?'
PS1_FULL="${PS1_TITLE}${PS1_HASHSTART}${PS1_TIME} ${PS1_INFO}${PS1_HASHEND}"
PS1_ERROR="\e[91m\$RET\e[0m"
PS1="${PS1_FULL}${PS1_PROMPT}"
PROMPT_COMMAND='RET=$?;if [ "$RET" != "0" ]; then PS1="${PS1_FULL} ${PS1_ERROR}\n${PS1_PROMPT}"; else PS1="${PS1_FULL}\n${PS1_PROMPT}"; fi; export PS1;'
 
export PS1_PROMPT
export PS1_FULL
export PS1_ERROR
export PS1
export PROMPT_COMMAND
### end the prompt bit ###
##########################
 
if [ "$WINDOWID" != "" ]; then
  xrdb ~/.Xresources
fi
 
alias admesg='sudo tail -n 0 -f /var/log/messages'
alias pingdd='sudo killall -USR1 dd'
alias mps='ps -U $USER U $USER -f'
alias nano='nano -wzSA -T 2'
alias less='less -cR'
alias su='sudo su'
alias l='ls'
alias ll='ls -l'
alias lll='ls -la'
alias x='exit'
alias j='jobs'
 
umask 0077
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox