Skip to content

Commit

Permalink
Simplified bash settings (just a bit)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dondi committed Jul 24, 2013
1 parent fe4c19a commit adb26f6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 32 deletions.
14 changes: 2 additions & 12 deletions bash_profile
@@ -1,13 +1,3 @@
if [ -f ~/.bashrc ]; then
source ~/.bashrc
if [ -f $HOME/.bashrc ]; then
source $HOME/.bashrc
fi

# if test -e /usr/local/bin/brew; then
# if [ -f `brew --prefix`/etc/bash_completion ]; then
# . `brew --prefix`/etc/bash_completion
# fi
# fi

#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # Load RVM into a shell session *as a function*

if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
41 changes: 21 additions & 20 deletions bashrc
@@ -1,3 +1,18 @@
function power() {
/usr/sbin/ioreg -l | awk 'BEGIN{a=0;b=0}
$0 ~ "MaxCapacity" {a=$5;next}
$0 ~ "CurrentCapacity" {b=$5;nextfile}
END{printf("%.2f%%", b/a * 100)}';
}

function setenv() {
if [ $# = 2 ]; then
export $1=$2;
else
echo "Usage: setenv [NAME] [VALUE]";
fi
}

if [ -n "$PS1" ]; then
if [ $TERM = 'xterm-color' -o $TERM = 'xterm-256color' ]; then
COLOR_DEFAULT="[00m"
Expand All @@ -23,32 +38,18 @@ if [ -n "$PS1" ]; then
alias ls='ls --color=auto'
fi
fi
fi

if [ -f ~/.exports ]; then
source ~/.exports
if [ -f "$HOME/.exports" ]; then
source "$HOME/.exports"
fi

if [ -f ~/.aliases ]; then
source ~/.aliases
if [ -f "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi

shopt -s histappend

power() {
/usr/sbin/ioreg -l | awk 'BEGIN{a=0;b=0}
$0 ~ "MaxCapacity" {a=$5;next}
$0 ~ "CurrentCapacity" {b=$5;nextfile}
END{printf("%.2f%%", b/a * 100)}'
}

function setenv() {
if [ $# = 2 ]; then
export $1=$2;
else
echo "Usage: setenv [NAME] [VALUE]";
fi
}
fi

export PATH="$HOME/.rbenv/bin:$PATH"

eval "$(rbenv init -)"

0 comments on commit adb26f6

Please sign in to comment.