Navigation Menu

Skip to content

Commit

Permalink
Rework work script to use git includes
Browse files Browse the repository at this point in the history
Also recolor prompt
  • Loading branch information
Rich Healey committed Apr 27, 2012
1 parent 13763b2 commit ea417c8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
25 changes: 17 additions & 8 deletions bin/work
@@ -1,10 +1,19 @@
#!/bin/sh

if [ -z "$1" ]; then
echo "usage: $0 no[work]"
exit 1
fi

rm -f "/tmp/$USER-nowork"
rm -f "/tmp/$USER-work"
touch "/tmp/$USER-$1"
case $1 in
"work")
rm -f "/tmp/$USER-nowork"
cat > "/tmp/$USER-work" <<-EOF
[user]
name = Rich Healey
email = richard.healey@99designs.com
EOF
;;
"nowork")
rm -f "/tmp/$USER-work"
touch "/tmp/$USER-nowork"
;;
*)
echo "usage: $0 no[work]"
exit 1;;
esac
2 changes: 2 additions & 0 deletions gitconfig
Expand Up @@ -2,6 +2,8 @@
name = richo
email = richo@psych0tik.net
signingkey = 89E72415
[include]
path = /tmp/richo-work
[user "work"]
name = Richard Healey
email = richard.healey@99designs.com
Expand Down
7 changes: 0 additions & 7 deletions profile
Expand Up @@ -238,13 +238,6 @@ for _rvm in "$HOME/.rvm/scripts/rvm" "/usr/local/rvm/scripts/rvm"; do
fi
done

if [ -f "/tmp/$USER-work" ]; then
export GIT_COMMITTER_NAME="Rich Healey"
export GIT_COMMITTER_EMAIL="richard.healey@99designs.com"
export GIT_AUTHOR_NAME="Rich Healey"
export GIT_AUTHOR_EMAIL="richard.healey@99designs.com"
fi

[ -e ~/.profile.local ] &&
source ~/.profile.local
[ -e ~/.profile.$sHost ] &&
Expand Down
7 changes: 6 additions & 1 deletion zshrc
Expand Up @@ -103,7 +103,7 @@ function __richo_rvm_version()
fi
}

PS1="${SHELL_COLOR}%(?.%m.\$(__richo_host) $PR_BRIGHT_RED%?)%b $PR_BRIGHT_BLUE\$richo_prompt $PR_RESET"
PS1="${SHELL_COLOR}%(?.%m.\$(__richo_host) $PR_BRIGHT_RED%?)%b \$richo_prompt_color\$richo_prompt $PR_RESET"
PS2="${SHELL_COLOR}%_ $PR_BRIGHT_BLUE> $PR_RESET"
RPS1="$PR_BRIGHT_BLUE\$richo_pwd "
which rvm-prompt > /dev/null &&
Expand Down Expand Up @@ -287,6 +287,11 @@ add-zsh-hook chpwd __git_ignore_hook
# }}}
function __richo_precmd() # {{{
{
if [ -f /tmp/richo-work ]; then
richo_prompt_color=$PR_BRIGHT_MAGENTA
else
richo_prompt_color=$PR_BRIGHT_BLUE
fi
vcs_info 'prompt'
if [ -n "$reTITLE" -a -n "$INSCREEN" ]; then
__set_title $reTITLE
Expand Down

0 comments on commit ea417c8

Please sign in to comment.