Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > OSX and Hackint0sh/OSX86 > Genuine Mac Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2009, 01:33 AM
unl0cker's Avatar
unl0cker
Status: Offline
Senior Member
 
Join Date: Jul 2007
Location: In my Mind
Posts: 122
Rep Power: 10
unl0cker is on a distinguished road
Default Bashrc - The way it should be!

Hey guys.

So one of the apps I most use is the Terminal. And I really think
osxs Terminal is a cool app, but the default Terminal options/profiles simply does not cut it.

Well, the terminal does not read the file ~/.bashrc, but IT DOES read ~/.profile. So here is my .profile and a screnie of it.


PS: I have ports and many gnu stuff installed. Things like bc, dircolors, coreutils, etc need to be installed else you'll not get the same result.

SCREENIE:



THE BASHRC
Quote:
set +v

if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi

export PATH="/usr/local/coreutils:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/X11R6/bin:/opt/local/bin" ## Change to suit your needs!
export MAILCHECK=0
export EDITOR=/bin/nano
export VISUAL=$EDITOR
export PAGER=/usr/bin/less
export SHELL=/bin/bash
export LESS='-iMn'
export PERLIO=stdio ## Apparently you need this for dvdrip.
export PRINTER=/usr/bin/lp
export CVS_RSH=/usr/bin/ssh
export HISTCONTROL=ignoreboth
export HISTIGNORE='l:ll:llt:cdb:b:r:exit:env:date:pwd:cfg :rb:eb:!!:ls:fg:bg:cd ..'
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33: so=01;35:do=01;35:bd=40;33;01:cd=40;33;01r=01;05 ;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=0 1;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;3 2:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31: *.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z= 01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01; 31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.rar=01;31: *.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*. rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bm p=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm= 01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=0 1;35:*.xcf=01;35:*.pcx=01;35:*.mpg=01;35:*.mpeg=01 ;35:*.m2v=01;35:*.avi=01;35:*.mkv=01;35:*.ogm=01;3 5:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.mov=01;35 :*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.r mvb=01;35:*.flc=01;35:*.fli=01;35:*.gl=01;35:*.dl= 01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=0 0;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00 ;32:*.mp3=00;36:*.wav=00;36:*.mid=00;36:*.midi=00; 36:*.au=00;36:*.ogg=00;36:*.flac=00;36:*.aac=00;36 :'


for POSSIBLE_PATH_DIR in "$HOME/bin" "$HOME/afsbin"; do
[[ -d "$POSSIBLE_PATH_DIR" ]] && [[ -x "$POSSIBLE_PATH_DIR" ]] && export PATH="$PATH:$POSSIBLE_PATH_DIR"
done ## Stole this out of Chris Povirk's bashrc. Focal Finesse

for LINUX_COMPATS in "/usr/compat/linux/bin" "/usr/compat/linux/sbin"; do
[[ -d "$LINUX_COMPATS" ]] && [[ -x "$LINUX_COMPATS" ]] && export PATH="$LINUX_COMPATS:$PATH" ## If your on FreeBSD or what ever, and if you have linux
done ## compats, it will use them. Makes all the alias for gnu
## userland tools still work.
for GNU_STUFF_ON_UNIX in "/usr/local/bin" "/usr/local/sbin"; do
[[ -d "$GNU_STUFF_ON_UNIX" ]] && [[ -x "$GNU_STUFF_ON_UNIX" ]] && export PATH="$PATH:$GNU_STUFF_ON_UNIX"
done ## If you are on BSD or what ever, alot of gnu tools get installed in /usr/local/*

case $TERM in ## Also stole this from Chris's bashrc.

screen)
TERM_IS_COLOR=true
TERM_NOT_RECOGNIZED_AS_COLOR_BY_VIM=false
TERM_NOT_RECOGNIZED_BY_SUN_UTILS=false
TERM_CAN_TITLE=true
;;

xterm-color|color_xterm|rxvt|Eterm|screen*) # screen.linux|screen-w
TERM_IS_COLOR=true
TERM_NOT_RECOGNIZED_AS_COLOR_BY_VIM=false
TERM_NOT_RECOGNIZED_BY_SUN_UTILS=true
TERM_CAN_TITLE=true
;;

linux)
TERM_IS_COLOR=true
TERM_NOT_RECOGNIZED_AS_COLOR_BY_VIM=false
TERM_NOT_RECOGNIZED_BY_SUN_UTILS=true
TERM_CAN_TITLE=false
;;

xterm|vt100)
TERM_IS_COLOR=true
TERM_NOT_RECOGNIZED_AS_COLOR_BY_VIM=true
TERM_NOT_RECOGNIZED_BY_SUN_UTILS=false
TERM_CAN_TITLE=true
;;

*xterm*|eterm|rxvt*)
TERM_IS_COLOR=true
TERM_NOT_RECOGNIZED_AS_COLOR_BY_VIM=true
TERM_NOT_RECOGNIZED_BY_SUN_UTILS=true
TERM_CAN_TITLE=true
;;

*)
TERM_IS_COLOR=false
TERM_NOT_RECOGNIZED_AS_COLOR_BY_VIM=false
TERM_NOT_RECOGNIZED_BY_SUN_UTILS=false
TERM_CAN_TITLE=false
;;

esac

# Change the window title of X terminals
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
;;
screen)
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
;;
esac

eval `dircolors --sh ~/.DIR_COLORS`

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

alias ls='ls --color=auto -CFX'
alias pg='ps aux | grep'
alias gvim='gvim -fn 6x10'
alias bc='bc -ql'
alias eqb='equery b'
alias la='ls -alshX'
alias psall='ps aux'
alias psu='ps uxU $1'
alias psg='ps aux | grep $1'
alias lscrn='screen -ls'
alias nscrn='screen -S $1'
alias ascrn='screen -D -R $1'
alias k9='kill -9 $1'
alias df='df -kHl'
alias traceroute='traceroute -I'
alias cp='cp -p'
alias cls='clear'
alias updatedb='/usr/libexec/locate.updatedb'
alias cpu='top -o cpu'

umask 077 # READ THE NOTE ABOUT UMASK OR DIE!
set -o emacs # Emacs key bindings
bind 'C-u:kill-whole-line' # Ctrl-U kills whole line
bind 'set bell-style visible' # No beeping
#bind 'set horizontal-scroll-mode on' # Don't wrap
bind 'set show-all-if-ambiguous on' # Tab once for complete
bind 'set visible-stats on' # Show file info in complete


shopt -s histappend
shopt -s checkwinsize
safe_term=${TERM//[^[:alnum:]]/.} # sanitize TERM

# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS. Try to use the external file
# first to take advantage of user additions. Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
match_lhs=""
[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
[[ -z ${match_lhs} ]] \
&& match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true

if ${use_color} ; then
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
if [[ -f ~/.dir_colors ]] ; then
eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
eval $(dircolors -b /etc/DIR_COLORS)
fi
fi


swap () { # swap 2 filenames around
if [ $# -ne 2 ]; then
echo "sintaxe: swap file1 file2"; return 1
fi
if [ ! -e $1 ]; then
echo "swap: $1 does not exist"; return 1
fi
if [ ! -e $2 ]; then
echo "swap: $2 does not exist"; return 1
fi
local TMPFILE=tmp.$$ ; mv $1 $TMPFILE ; mv $2 $1 ; mv $TMPFILE $2
}


rot13 () { # For some reason, rot13 pops up everywhere
if [ $# -eq 0 ]; then
tr '[a-m][n-z][A-M][N-Z]' '[n-z][a-m][N-Z][A-M]'
else
echo $* | tr '[a-m][n-z][A-M][N-Z]' '[n-z][a-m][N-Z][A-M]'
fi
}

function search() {
find / -iname '*'$1'*';
}


dirsize () {
TotalBytes=0
for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }')
do
let TotalBytes=$TotalBytes+$Bytes
done
TotalMeg=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc)
echo -n "$TotalMeg"
}

HISTSIZE=5000

PS1="\[\033[32m\][\[\033[0m\]\u\[\033[32m\]@\[\033[0m\]\h\[\033[32m\]] (\$(dirsize) MB) [\[\033[0m\]\w\[\033[32m\]]\[\033[32m\] #\[\033[0m\] "

set +v
__________________
.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +2. The time now is 11:16 PM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105