Browse files

Bash smiley as a function

  • Loading branch information...
1 parent 252eb64 commit a10e27cbd8e94cb360ed2eeb57dfbcd66fb12c75 @stianeikeland committed Apr 3, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 bash/bashrc
View
10 bash/bashrc
@@ -10,10 +10,18 @@ SELECT="if [ \$? = 0 ]; then echo \"${SMILEY}\"; else echo \"${FROWNY}\"; fi"
USERHOST='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h'
LOCATION='\[\e[33m\]\w\[\e[0m\]'
+smiley () {
+ if [ $? == 0 ]; then
+ echo $SMILEY
+ else
+ echo $FROWNY
+ fi
+}
+
#PS1="${USERHOST}${NORMAL}:${LOCATION}${RED}\`__git_ps1\`${NORMAL} \`${SELECT}\`\n\$ "
#PS1="┌─[\[\e[34m\]\h\[\e[0m\]][\[\e[32m\]\w\[\e[0m\]]\n└─╼ "
GIT_PS1_SHOWDIRTYSTATE=1
-PS1="┌─[\[\e[34m\]\h\[\e[0m\]][\[\e[32m\]\w\[\e[0m\]]${YELLOW}\`__git_ps1\`${NORMAL} \`${SELECT}\`\n└─╼ "
+PS1="┌─[\[\e[34m\]\h\[\e[0m\]][\[\e[32m\]\w\[\e[0m\]]${YELLOW}\`__git_ps1\`${NORMAL} $(smiley)\n└─╼ "
# Enable options:

0 comments on commit a10e27c

Please sign in to comment.